Skip to content

Latest commit

 

History

History
15 lines (11 loc) · 523 Bytes

serverless-error.md

File metadata and controls

15 lines (11 loc) · 523 Bytes

Generic class to report user errors in Serverless Inc. CLI products

ServerlessError(message, code, options = { ... })

  • message - Error message
  • code - Error code
  • Supported options (all optional):
    • decoratedMessage - Eventual decorated (with ANSI styling) version of a message to be passed throught to stdout as is
const ServerlessError = require('@serverless/utils/serverless-error');
...

new ServerlessError("Service cannot be deployed in given region", 'REGION_MISMATCH');