/** * The purpose of this class is to help make the SharePoint framework errors more robust. * On top of the base Error class functionality, this class adds the concept of error codes. * The error code could be a non-localized immutable string or an error number. All the * SharePoint framework code is expected to use this class for raising errors. * * References: * * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error} * * {@link http://stackoverflow.com/questions/1382107/whats-a-good-way-to-extend-error-in-javascript} * * @alpha */ export default class SPError extends Error { /** * Inner error. */ innerError: Error | undefined; /** * Error id. * e.g. Value of the enum. */ get id(): number; /** * Error category. */ get category(): string; private _errorCode; private _errorString; private _logProperties; private static _generateErrorStackForIE; /** * Constructor for the SPError class. * * @param errorCode - a numeric or string error code. * @param message - detailed error message. * @param logProperties - (optional) additional data that can be used to troubleshoot rare to repro bugs. * */ constructor(errorCode: string, message: string, logProperties?: { [key: string]: any; }); /** * Return a string equivalent of the error for display purposes. * * @returns string representation of the error. */ toStringForUI(): string; /** * Return a string equivalent of the error for logging purposes. * * @returns string representation of the error. */ toString(): string; /** * Return a string equivalent of the error for logging or display purposes. * * @returns string representation of the error. */ _toString(logDebug?: boolean): string; } //# sourceMappingURL=SPError.d.ts.map