Abstract
You should use AmplifyUserError or AmplifyLibraryFault to throw an error.
a user friendly name for the exception
LibraryFault or UserError
error stack, resolution steps, details, or help links
Optional
cause: ErrorIf you are throwing this exception from within a catch block, you must provide the exception that was caught.
Optional
Readonly
causeIf you are throwing this exception from within a catch block, you must provide the exception that was caught.
Readonly
classificationLibraryFault or UserError
Optional
Readonly
codeOptional
Readonly
detailsOptional
Readonly
linkReadonly
messageReadonly
namea user friendly name for the exception
Optional
Readonly
resolutionOptional
serializedOptional
stackStatic
Optional
prepareOptional override for formatting stack traces
Static
stackStatic
captureCreate .stack property on a target object
Optional
constructorOpt: FunctionStatic
fromStatic
fromStatic
isThis function is a type predicate for AmplifyError. See https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates.
Checks if error is an AmplifyError by inspecting if required properties are set. This is recommended instead of instanceof operator. The instance of operator does not work as expected if AmplifyError class is loaded from multiple sources, for example when package manager decides to not de-duplicate dependencies. See https://github.com/nodejs/node/issues/17943.
Base class for all Amplify errors or faults