A subclass of Error that is thrown by faast.js APIs and cloud function invocations.
export declare class FaastError extends VError
FaastError is a subclass of VError, which provides an API for nested error handling. The main API is the same as the standard Error class, namely the FaastError.message, FaastError.name, and FaastError.stack properties. In addition, the FaastError.fullStack property provides a more detailed stack trace.
FaastError can be returned in two situations. In the first situation, faast.js itself is reporting an error when it encounters a situation it cannot handle. In the second situation, the user's cloud function is throwing an error (or returning a rejected
Promise). In the second situation, the original error class is not re-created on the client side because faast.js cannot reliably instantiate foreign subclasses of
Error. Instead, all of the properties of the
Error on the remote side are serialized and sent to the local side. These properties are available on the FaastError.info object. In addition, FaastError.functionName is the name of the function that was invoked, and FaastError.args are the arguments used to invoke the function that caused the error.
If available, FaastError.logUrl will be a URL pointing to the logs for the specific invocation that caused the error. The
logUrl will be appended to the end of FaastError.message and FaastError.fullStack as well.
logUrl be surrounded by whilespace on both sides to ease parsing as a URL by IDEs.
|args||For errors returned from a cloud function call, these are the arguments that caused the failed invocation.|
|code||Error code, if any.|
|fullStack||The full stack trace including stack traces for underlying causes, if any.|
|functionName||For errors returned from a cloud function call, this is the function name that was invoked that caused the error.|
|info||Get additional metadata about this error. For errors returned from a remote cloud function call, the returned object will contain all of the properties from the original error on the remote side.|
|logUrl||The log URL if this |
|message||The error message. If nested errors occurred, this message summarizes all nested errors separated with colons (:).|
|stack||The stack trace for the error without include traces for underlying errors. A more complete stack trace is available under FaastError.fullStack.|
|cause()||The underlying cause of the error, if any. This cause is also reflected in FaastError.message and FaastError.fullStack.|