Hack
AtomForErrorCode:
PROC [code: InternalErrorCode]
RETURNS [atom:
ATOM] ~ {
atom ←
SELECT code
FROM
badCredentials => $badCredentials,
illegalAttributeType => $illegalAttributeType,
illegalAttributeValue => $illegalAttributeValue,
illegalControlType => $illegalControlType,
illegalControlValue => $illegalControlValue,
illegalScope => $illegalScope,
illegalScopeValue => $illegalScopeValue,
illegalSession => $illegalSession,
fileBusy => $fileBusy,
fileHandleError => $fileHandleError,
insertionError => $insertionError,
rangeError => $rangeError,
crRPCError => $crRPCError,
unexpectedClose => $unexpectedClose,
connectionTimedOut => $connectionTimedOut,
connectionTrouble => $connectionTrouble,
serviceProblem => $serviceProblem,
transferError => $transferError,
undefinedError => $undefinedError,
ENDCASE => ERROR;
};
InternalErrorCode:
TYPE ~ {
--user:-- badCredentials,
--client:-- illegalAttributeType, illegalAttributeValue, illegalControlType, illegalControlValue, illegalScope, illegalScopeValue,
--client:-- illegalSession, fileBusy, fileHandleError, insertionError, rangeError,
--environ:-- crRPCError, unexpectedClose, connectionTimedOut, connectionTrouble, serviceProblem, transferError,
--bug:-- undefinedError
};
Bug:
PROC [code: InternalErrorCode[undefinedError..undefinedError], msg:
ROPE] ~ {
atom: ATOM ~ AtomForErrorCode[code];
error: PFS.ErrorDesc ~ [$bug, atom, msg];
ERROR PFS.Error[error];
};
ClientError:
PROC [code: InternalErrorCode[illegalAttributeType..rangeError], msg:
ROPE] ~ {
atom: ATOM ~ AtomForErrorCode[code];
error: PFS.ErrorDesc ~ [$client, atom, msg];
ERROR PFS.Error[error];
};
EnvironError:
PROC [code: InternalErrorCode[crRPCError..transferError], msg:
ROPE] ~ {
atom: ATOM ~ AtomForErrorCode[code];
error: PFS.ErrorDesc ~ [$environment, atom, msg];
ERROR PFS.Error[error];
};
UserError:
PROC [code: InternalErrorCode[badCredentials..badCredentials], msg:
ROPE] ~ {
atom: ATOM ~ AtomForErrorCode[code];
error: PFS.ErrorDesc ~ [$user, atom, msg];
ERROR PFS.Error[error];
};
BackdoorError:
PROC [code: PFSBackdoor.ErrorCode, msg:
ROPE] ~
INLINE {
PFSBackdoor.ProduceError[code, msg];
};
UnknownError:
PROC [pathname:
ROPE, time: BasicTime.
GMT] ~ {
msg: ROPE ~ IO.PutFR["%g of %g", IO.rope[pathname], IO.time[time] ];
BackdoorError[$unknownFile, msg];
};
Text Arrays
RopeForText:
PROC [text:
STRING]
RETURNS [rope:
ROPE] ~ {
avoid: XR𡤊ssignRefInit((word) xx, (word) XR←GetRefLiteral((* xx ), (word) &string));
ref: REF READONLY TEXT;
TRUSTED { ref ← LOOPHOLE[text] };
rope ← RefText.TrustTextAsRope[ref];
};
REQUIREDTEXT: TYPE ~ <<READONLY>> STRING ← ; -- no default value!
AuthenticationP14V2
callProblemText:
PUBLIC
ARRAY AuthenticationP14V2.CallProblem
OF
REQUIREDTEXT ← [
tooBusy: "tooBusy",
accessRightsInsufficient: "accessRightsInsufficient",
keysUnavailable: "keysUnavailable",
strongKeyDoesNotExist: "strongKeyDoesNotExist",
simpleKeyDoesNotExist: "simpleKeyDoesNotExist",
strongKeyAlreadyRegistered: "strongKeyAlreadyRegistered",
simpleKeyAlreadyRegistered: "simpleKeyAlreadyRegistered",
domainForNewKeyUnavailable: "domainForNewKeyUnavailable",
domainForNewKeyUnknown: "domainForNewKeyUnknown",
badKey: "badKey",
badName: "badName",
databaseFull: "databaseFull",
other: "other"
];
problemText:
PUBLIC
ARRAY AuthenticationP14V2.Problem
OF
REQUIREDTEXT ← [
credentialsInvalid: "credentialsInvalid",
verifierInvalid: "verifierInvalid",
verifierExpired: "verifierExpired",
verifierReused: "verifierReused",
credentialsExpired: "credentialsExpired",
inappropriateCredentials: "inappropriateCredentials"
];
CrRPC
errorReasonText:
PUBLIC
ARRAY CrRPC.ErrorReason
OF
REQUIREDTEXT ← [
unknown: "unknown",
unknownClass: "unknownClass",
courierVersionMismatch: "courierVersionMismatch",
rejectedNoSuchProgram: "rejectedNoSuchProgram",
rejectedNoSuchVersion: "rejectedNoSuchVersion",
rejectedNoSuchProcedure: "rejectedNoSuchProcedure",
rejectedInvalidArgument: "rejectedInvalidArgument",
rejectedUnspecified: "rejectedUnspecified",
remoteError: "remoteError",
cantConnectToRemote: "cantConnectToRemote",
argsError: "argsError",
resultsError: "resultsError",
bulkDataError: "bulkDataError",
protocolError: "protocolError",
remoteClose: "remoteClose",
communicationFailure: "communicationFailure",
notImplemented: "notImplemented",
unknownOperation: "unknownOperation",
notServerHandle: "notServerHandle",
notClientHandle: "notClientHandle",
addressInappropriateForClass: "addressInappropriateForClass",
other: "other"
];
FilingP10V5
accessProblemText:
PUBLIC
ARRAY FilingP10V5.AccessProblem
OF
REQUIREDTEXT ← [
accessRightsInsufficient: "accessRightsInsufficient",
accessRightsIndeterminate: "accessRightsIndeterminate",
fileChanged: "fileChanged",
fileDamaged: "fileDamaged",
fileInUse: "fileInUse",
fileNotFound: "fileNotFound",
fileOpen: "fileOpen"
];
argumentProblemText:
PUBLIC
ARRAY FilingP10V5.ArgumentProblem
OF
REQUIREDTEXT ← [
illegal: "illegal",
disallowed: "disallowed",
unreasonable: "unreasonable",
unimplemented: "unimplemented",
duplicated: "duplicated",
missing: "missing"
];
ConnectionProblemSubRange: TYPE ~ FilingP10V5. ConnectionProblem[noRoute..returnTimedOut];
connectionProblemText:
PUBLIC
ARRAY ConnectionProblemSubRange
OF
REQUIREDTEXT ← [
noRoute: "noRoute",
noResponse: "noResponse",
transmissionHardware: "transmissionHardware",
transportTimeout: "transportTimeout",
tooManyLocalConnections: "tooManyLocalConnections",
tooManyRemoteConnections: "tooManyRemoteConnections",
missingCourier: "missingCourier",
missingProgram: "missingProgram",
missingProcedure: "missingProcedure",
protocolMismatch: "protocolMismatch",
parameterInconsistency: "parameterInconsistency",
invalidMessage: "invalidMessage",
returnTimedOut: "returnTimedOut"
];
controlTypeText:
PUBLIC
ARRAY FilingP10V5.ControlType
OF
REQUIREDTEXT ← [
lock: "lock",
timeout: "timeout",
access: "access"
];
directionText:
PUBLIC
ARRAY FilingP10V5.Direction
OF
REQUIREDTEXT ← [
forward: "forward",
backward: "backward"
];
filterTypeText:
PUBLIC
ARRAY FilingP10V5.FilterType
OF
REQUIREDTEXT ← [
less: "less",
lessOrEqual: "lessOrEqual",
equal: "equal",
notEqual: "notEqual",
greaterOrEqual: "greaterOrEqual",
greater: "greater",
and: "and",
or: "or",
not: "not",
none: "none",
all: "all",
matches: "matches"
];
handleProblemText:
PUBLIC
ARRAY FilingP10V5.HandleProblem
OF
REQUIREDTEXT ← [
invalid: "invalid",
nullDisallowed: "nullDisallowed",
directoryRequired: "directoryRequired"
];
insertionProblemText:
PUBLIC
ARRAY FilingP10V5.InsertionProblem
OF
REQUIREDTEXT ← [
positionUnavailable: "positionUnavailable",
fileNotUnique: "fileNotUnique",
loopInHierarchy: "loopInHierarchy"
];
lockText:
PUBLIC
ARRAY FilingP10V5.Lock
OF
REQUIREDTEXT ← [
lockNone: "lockNone",
share: "share",
exclusive: "exclusive"
];
scopeTypeText:
PUBLIC
ARRAY FilingP10V5.ScopeType
OF
REQUIREDTEXT ← [
count: "count",
direction: "direction",
filter: "filter",
depth: "depth"
];
serviceProblemText:
PUBLIC
ARRAY FilingP10V5.ServiceProblem
OF
REQUIREDTEXT ← [
cannotAuthenticate: "cannotAuthenticate",
serviceFull: "serviceFull",
serviceUnavailable: "serviceUnavailable",
sessionInUse: "sessionInUse",
serviceUnknown: "serviceUnknown"
];
sessionProblemText:
PUBLIC
ARRAY FilingP10V5.SessionProblem
OF
REQUIREDTEXT ← [
tokenInvalid: "tokenInvalid",
serviceAlreadySet: "serviceAlreadySet"
];
spaceProblemText:
PUBLIC
ARRAY FilingP10V5.SpaceProblem
OF
REQUIREDTEXT ← [
allocationExceeded: "allocationExceeded",
attributeAreaFull: "attributeAreaFull",
mediumFull: "mediumFull"
];
strengthText:
PUBLIC
ARRAY FilingP10V5.Strength
OF
REQUIREDTEXT ← [
none: "none",
simple: "simple",
strong: "strong"
];
transferProblemText:
PUBLIC
ARRAY FilingP10V5.TransferProblem
OF
REQUIREDTEXT ← [
aborted: "aborted",
checksumIncorrect: "checksumIncorrect",
formatIncorrect: "formatIncorrect",
noRendevous: "noRendevous",
wrongDirection: "wrongDirection"
];
}.