@persian-caesar/aparat.js
Version:
The aparat website services for npm package.
26 lines (25 loc) • 1.11 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.APIError = void 0;
// Custom error class for API errors, extending the built-in Error class.
class APIError extends Error {
// The constructor accepts an error code and a message.
constructor(code, // The specific error code associated with the error.
message // A descriptive message for the error.
) {
super(message); // Pass the message to the parent Error class.
this.code = code;
this.name = "AparatAPIError"; // Set a custom error name for easier identification.
// Fix the prototype chain to ensure instanceof works correctly.
Object.setPrototypeOf(this, APIError.prototype);
}
}
exports.APIError = APIError;
/**
* @copyright
* Code by Sobhan-SRZA (mr.sinre) | https://github.com/Sobhan-SRZA
* Developed for Persian Caesar | https://github.com/Persian-Caesar | https://dsc.gg/persian-caesar
*
* If you encounter any issues or need assistance with this code,
* please make sure to credit "Persian Caesar" in your documentation or communications.
*/