Download admin-bro/src/backend/utils/errors/configuration-error.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 783 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/admin-bro/src/backend/utils/errors/configuration-error.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/admin-bro/src/backend/utils/errors/configuration-error.ts
-
curl -L -o configuration-error.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/admin-bro/src/backend/utils/errors/configuration-error.ts
783 Bytes
| import { ErrorTypeEnum } from '../../../utils/error-type.enum.js' | |
| import * as CONSTANTS from '../../../constants.js' | |
| const buildUrl = (page: string): string => ( | |
| `${CONSTANTS.DOCS}/${page}` | |
| ) | |
| /** | |
| * Error which is thrown when user messed up something in the configuration | |
| * | |
| * @category Errors | |
| */ | |
| export class ConfigurationError extends Error { | |
| /** | |
| * @param {string} fnName name of the function, base on which error will | |
| * print on the output link to the method documentation. | |
| * @param {string} message | |
| */ | |
| constructor(message, fnName) { | |
| const msg = ` | |
| ${message} | |
| More information can be found at: ${buildUrl(fnName)} | |
| ` | |
| super(msg) | |
| this.message = msg | |
| this.name = ErrorTypeEnum.Configuration | |
| } | |
| } | |
| export default ConfigurationError | |