Error Transformations

Summary

OSID methods define possible error conditions. According to the OSID Specification, an OSID method returns the specified value type (or nothing) or an Error is returned. Except in the case where an OSID method implies an pseudo-asynchronous behavior, one or the other must occur when control is returned to an OSID Consumer. No mechanisms such as external error statuses or messages are possible.

OSID Errors are grouped into four Error Categories indicating to whom the error pertains.

Transformations

OSID Errors map to Java Exceptions. org.osid.OsidException is defined to group the Error Categories that will map to checked exceptions. org.osid.OsidRuntimeException is defined to group the Error Categories that will map to unchecked exceptions. Unchecked exceptions are used in places where the OSID Consumer should not need to catch and process them, such as programming errors. 

OSID Error CategoryOSID ErrorJava ExceptionJava Class ParentDescription
  org.osid.OsidExceptionjava.lang.ExceptionThese exceptions are checked exceptions in Java.
User org.osid.UserExceptionorg.osid.OsidException

The category of user errors are the result of a user action and directed toward the user.

UserALREADY_EXISTSorg.osid.AlreadyExistsExceptionorg.osid.UserException

Attempt to add a relation that already exists. Typically, these are used where two OSID IDs are mapped to each other in some way, and that mapping already exists.

UserNOT_FOUNDorg.osid.NotFoundExceptionorg.osid.UserExceptionThe object or relation requested by a primary unique Id was not found. These typically are not used when looking up objects by a related object or by some other data element where the lookup key is not a primary unique identifier and an empty list if returned.
UserPERMISSION_DENIEDorg.osid.PermissionDeniedExceptionorg.osid.UserExceptionAn authorization failure occurred. These are thrown when the authorization failure is pertinent to the user and is desirable to expose that fact as opposed to a Java security or file permission error that the user cannot do anything about. The latter cases would fall under OPERATION_FAILED.
Operational org.osid.OperationalExceptionorg.osid.OsidExceptionThe category of operational or system errors that may occur and are directed toward the user.

Operational

CONFIGURATION_ERRORorg.osid.ConfigurationErrorExceptionorg.osid.OperationalExceptionA configuration error occurred during initializing an OSID.
OperationalOPERATION_FAILEDorg.osid.OperationFailedExceptionorg.osid.OperationalException

A problem occurred in the execution of an OSID method. This covers the gamut of unavoidable operational problems not attributable to the other operational categories. Examples are the database is down or creating a circular dependency.

OperationalTRANSACTION_FAILUREorg.osid.TransactionFailureExceptionorg.osid.OperationalExceptionAn error occurred while committing a transaction using the osid.transaction.Transaction interface.
  org.osid.OsidRuntimeExceptionjava.lang.RuntimeExceptionThese exceptions are unchecked exceptions in Java. These exceptions are defined where there are alternatives to avoid them such as checking for compliance or testing one's code.
ConsumerContract org.osid.ConsumerContractExceptionorg.osid.OsidRuntimeExceptionThe category of errors used where an OSID Consumer has violated the contract.
ConsumerContractILLEGAL_STATEorg.osid.IllegalStateExceptionorg.osid.ConsumerContractException

A method has been executed at an inappropriate time. 

ConsumerContractINVALID_ARGUMENTorg.osid.InvalidArgumentExceptionorg.osid.ConsumerContractException

A bad value supplied to an OSID method parameter. 

ConsumerContractINVALID_METHODorg.osid.InvalidMethodExceptionorg.osid.ConsumerContractException

The OSID Consumer attempted to invoke an undefined method.

ConsumerContractNO_ACCESSorg.osid.NoAccessExceptionorg.osid.ConsumerContractException

An attempt at updating a read-only value.

ConsumerContractNULL_ARGUMENTorg.osid.NullArgumentExceptionorg.osid.ConsumerContractException

A null argument was provided to an OSID method. 

ConsumerContractUNIMPLEMENTEDorg.osid.UnimplementedExceptionorg.osid.ConsumerContractException

An OSID method was invoked but not implemented by an OSID Provider. These errors can only be defined when the compliance is optional. 

ConsumerContractUNSUPPORTEDorg.osid.UnsupportedExceptionorg.osid.ConsumerContractException

An OSID Provider does not support the supplied data or data type. 

ProviderContract org.osid.ProviderContractExceptionorg.osid.OsidRuntimeExceptionThe category of errors used where an OSID Provider has violated the contract.
ProviderContractBAD_LOGICorg.osid.BadLogicExceptionorg.osid.ProviderContractException

An OSID Provider exhibited incorrect behavior. 

ProviderContractINVALID_ERRORorg.osid.InvalidErrorExceptionorg.osid.ProviderContractException

An OSID Provider threw an exception not defined in an OSID method. 

ProviderContractINVALID_RETURNorg.osid.InvalidReturnExceptionorg.osid.ProviderContractException

An OSID Provider returned in invalid return value. 

ProviderContractMISSING_METHODorg.osid.MissingMethodExceptionorg.osid.ProviderContractException

A defined method is missing from the OSID Provider. 

ProviderContractNULL_RETURNorg.osid.NullReturnExceptionorg.osid.ProviderContractException

The OSID Provider returned a null. 

See Also

Copyright © 2014 Okapia.