UNPKG

gatsby-plugin-sharp

Version:

Wrapper of the Sharp image manipulation library for Gatsby plugins

28 lines (25 loc) 683 B
"use strict"; exports.__esModule = true; exports.SharpError = void 0; // This custom error should help us debug sharp errors when occurring. class SharpError extends Error { /** * * @param {string} message * @param {Error} err */ constructor(message, err = null) { let fullErrorMessage = message; if (err) { var _err$shortMessage; fullErrorMessage += ` Original error: ${(_err$shortMessage = err.shortMessage) !== null && _err$shortMessage !== void 0 ? _err$shortMessage : ``} ${err.message}`; } super(fullErrorMessage); this.name = `SharpError`; Error.captureStackTrace(this, SharpError); } } exports.SharpError = SharpError;