Add public tags and documentation in the error and config-loader packages
Part of #7688 Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
@@ -14,7 +14,7 @@ export class AuthenticationError extends CustomErrorBase {}
|
||||
// @public
|
||||
export class ConflictError extends CustomErrorBase {}
|
||||
|
||||
// @public (undocumented)
|
||||
// @public
|
||||
export class CustomErrorBase extends Error {
|
||||
constructor(message?: string, cause?: Error | unknown);
|
||||
// (undocumented)
|
||||
|
||||
@@ -16,7 +16,21 @@
|
||||
|
||||
import { isError } from './assertion';
|
||||
|
||||
/** @public */
|
||||
/**
|
||||
* A base class that custom Error classes can inherit from.
|
||||
*
|
||||
* @public
|
||||
* @example
|
||||
*```ts
|
||||
* class MyCustomError extends CustomErrorBase {}
|
||||
*
|
||||
* const e = new MyCustomError('Some message', cause);
|
||||
* // e.name === 'MyCustomError'
|
||||
* // e.message === 'Some message'
|
||||
* // e.cause === cause
|
||||
* // e.stack is set if the runtime supports it
|
||||
* ```
|
||||
*/
|
||||
export class CustomErrorBase extends Error {
|
||||
readonly cause?: Error;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user