Spaces:
Sleeping
Sleeping
pythonic-rag-FastAPIReact / frontend /node_modules /adjust-sourcemap-loader /lib /process /throw-errors.js
Download frontend/node_modules/adjust-sourcemap-loader/lib/process/throw-errors.js from sepidnes/pythonic-rag-FastAPIReact: direct link, hf CLI and curl.
- Browser
- Download file 841 Bytes
-
https://huggingface.co/spaces/sepidnes/pythonic-rag-FastAPIReact/resolve/c9f908872ebbec3c4fa1392419c0f6cd3750ddb3/frontend/node_modules/adjust-sourcemap-loader/lib/process/throw-errors.js
- Command line
-
hf download hf://spaces/sepidnes/pythonic-rag-FastAPIReact@c9f908872ebbec3c4fa1392419c0f6cd3750ddb3/frontend/node_modules/adjust-sourcemap-loader/lib/process/throw-errors.js
-
curl -L -o throw-errors.js https://huggingface.co/spaces/sepidnes/pythonic-rag-FastAPIReact/resolve/c9f908872ebbec3c4fa1392419c0f6cd3750ddb3/frontend/node_modules/adjust-sourcemap-loader/lib/process/throw-errors.js
841 Bytes
| ; | |
| var getError = require('./get-error'); | |
| /** | |
| * Where the given list is non-null and contains error instances then consolidate and throw | |
| * @throws Error | |
| * @param {string} resourcePath The path to the resource being processed | |
| * @param {null|Array} candidates A possible Array with possible error elements | |
| */ | |
| function throwErrors(resourcePath, candidates) { | |
| var errors = !!candidates && candidates | |
| .filter(testIsError) | |
| .map(getMessage); | |
| var hasError = !!errors && errors.length; | |
| if (hasError) { | |
| throw getError(['For resource: ' + resourcePath].concat(errors).join('\n')); | |
| } | |
| function testIsError(candidate) { | |
| return !!candidate && (typeof candidate === 'object') && (candidate instanceof Error); | |
| } | |
| function getMessage(error) { | |
| return error.message; | |
| } | |
| } | |
| module.exports = throwErrors; |