Changeset 2150

Show
Ignore:
Timestamp:
07/01/08 07:53:30 (3 months ago)
Author:
jon
Message:

[library] add toString() methods for all the exceptions listed in FortressLibrary?

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Library/FortressLibrary.fsi

    r2005 r2150  
    712712end 
    713713 
    714 object IndexOutOfBounds extends UncheckedException 
     714object IndexOutOfBounds(min:ZZ32,max:ZZ32,index:ZZ32) extends UncheckedException 
    715715end 
    716716 
  • trunk/Library/FortressLibrary.fss

    r2052 r2150  
    933933 
    934934object DivisionByZero extends UncheckedException 
     935    toString(): String = "Division by zero" 
    935936end 
    936937 
    937938object UnpastingError extends UncheckedException 
     939    toString(): String = "Unpasting error" 
    938940end 
    939941 
    940942object CallerViolation extends UncheckedException 
     943    toString(): String = "Caller violation" 
    941944end 
    942945 
    943946object CalleeViolation extends UncheckedException 
     947    toString(): String = "Callee violation" 
    944948end 
    945949 
    946950object TestFailure extends UncheckedException 
     951    toString(): String = "Test failure" 
    947952end 
    948953 
    949954object ContractHierarchyViolation extends UncheckedException 
     955    toString(): String = "Contract hierarchy violation" 
    950956end 
    951957 
    952958object NoEqualityOnFunctions extends UncheckedException 
     959    toString(): String = "No equality on functions" 
    953960end 
    954961 
    955962object InvalidRange extends UncheckedException 
     963    toString(): String = "Invalid range" 
    956964end 
    957965 
    958966object ForbiddenException(chain : Exception) extends UncheckedException 
     967    toString(): String = "Forbidden exception" 
    959968end 
    960969 
    961970(* Should this be called "IndexNotFound" instead? *) 
    962971object NotFound extends UncheckedException 
    963 end 
    964  
    965 object IndexOutOfBounds extends UncheckedException 
     972    toString(): String = "Not found" 
     973end 
     974 
     975object IndexOutOfBounds(min:ZZ32,max:ZZ32,index:ZZ32) extends UncheckedException 
     976    toString(): String = index " is outside the range " min " to " max 
    966977end 
    967978 
    968979object NegativeLength extends UncheckedException 
     980    toString(): String = "Negative length" 
    969981end 
    970982 
    971983object IntegerOverflow extends UncheckedException 
     984    toString(): String = "Integer Overflow" 
    972985end 
    973986 
    974987object RationalComparisonError extends UncheckedException 
     988    toString(): String = "Rational comparison error" 
    975989end 
    976990 
    977991object FloatingComparisonError extends UncheckedException 
     992    toString(): String = "Floating comparison error" 
    978993end 
    979994 
     
    984999 
    9851000object CastError extends CheckedException 
     1001    toString(): String = "Cast error" 
    9861002end 
    9871003 
    9881004object IOFailure extends CheckedException 
     1005    toString(): String = "I/O error" 
    9891006end 
    9901007 
    9911008object MatchFailure extends CheckedException 
     1009    toString(): String = "Match failure" 
    9921010end 
    9931011 
    9941012(* SetsNotDisjoint? *) 
    9951013object DisjointUnionError extends CheckedException 
     1014    toString(): String = "Disjoint union error" 
    9961015end 
    9971016 
    9981017object APIMissing extends CheckedException 
     1018    toString(): String = "Api is missing" 
    9991019end 
    10001020 
    10011021object APINameCollision extends CheckedException 
     1022    toString(): String = "Api name collides with another" 
    10021023end 
    10031024 
    10041025object ExportedAPIMissing extends CheckedException 
     1026    toString(): String = "Exported api is missing" 
    10051027end 
    10061028 
    10071029object HiddenAPIMissing extends CheckedException 
     1030    toString(): String = "Hidden api is missing" 
    10081031end 
    10091032 
    10101033object TryAtomicFailure extends CheckedException 
     1034    toString(): String = "Try/atomic failure" 
    10111035end 
    10121036 
    10131037(* Should take a spawned thread as an argument *) 
    10141038object AtomicSpawnSynchronization extends {UncheckedException} 
     1039    toString(): String = "Atomic spawn synchronization" 
    10151040end 
    10161041 
  • trunk/ProjectFortress/LibraryBuiltin/FortressBuiltin.fss

    r1771 r2150  
    202202        if 0 <= i < |self| 
    203203        then get(i) 
    204         else throw IndexOutOfBounds 
     204        else throw IndexOutOfBounds(0,(|self|)-1,i) 
    205205        end 
    206206    (** get skips bounds checking. **)