Class: NotFoundError
Defined in: web/lib/errors.ts:233
Resource not found error.
Remarks
Thrown when a requested resource does not exist. Includes the resource type and identifier for better error messages.
Example
const eprint = await getEprint(uri);
if (!eprint) {
throw new NotFoundError('Eprint', uri);
}
Extends
Constructors
new NotFoundError()
new NotFoundError(
resourceType,resourceId):NotFoundError
Defined in: web/lib/errors.ts:256
Creates a new NotFoundError.
Parameters
resourceType
string
Type of resource (e.g., 'Eprint', 'Author')
resourceId
string
Resource identifier (e.g., AT URI, DID)
Returns
Overrides
Properties
cause?
readonlyoptionalcause:Error
Defined in: web/lib/errors.ts:76
Original error that caused this error (if any).
Remarks
Error chaining allows tracking the full error context through multiple layers of the application. Useful for debugging complex error scenarios.
Inherited from
code
readonlycode:"NOT_FOUND"='NOT_FOUND'
Defined in: web/lib/errors.ts:234
Machine-readable error code.
Remarks
Error codes are unique identifiers for error types, enabling programmatic error handling (switch statements, error maps), error tracking in monitoring systems, and client-side error translation (i18n).
Overrides
resourceId
readonlyresourceId:string
Defined in: web/lib/errors.ts:248
Identifier of the resource that was not found.
Example
AT URI, DID, field ID
resourceType
readonlyresourceType:string
Defined in: web/lib/errors.ts:241
Type of resource that was not found.
Example
'Eprint', 'Review', 'Author', 'Field'
Accessors
isRetryable
Get Signature
get isRetryable():
boolean
Defined in: web/lib/errors.ts:109
Whether this error is retryable.
Remarks
Override in subclasses to indicate whether the operation can be retried. Default is false (non-retryable).
Returns
boolean
Inherited from
severity
Get Signature
get severity():
ErrorSeverity
Defined in: web/lib/errors.ts:98
Error severity for monitoring and alerting.
Remarks
Override in subclasses to customize severity based on error type. Default is 'medium' for most errors.
Returns
Inherited from
Methods
toJSON()
toJSON():
SerializedError
Defined in: web/lib/errors.ts:120
Converts error to a plain object for structured logging.
Returns
Remarks
Produces a JSON-serializable object with all error properties, including nested cause chains.