UNPKG

scorm-again

Version:

A modern SCORM JavaScript run-time library for AICC, SCORM 1.2, and SCORM 2004

30 lines (27 loc) 736 B
import { ValidationError } from "../exceptions"; import { aicc_constants } from "../constants/api_constants"; const aicc_errors = aicc_constants.error_descriptions; /** * AICC Validation Error */ export class AICCValidationError extends ValidationError { /** * Constructor to take in an error code * @param {number} errorCode */ constructor(errorCode: number) { if ({}.hasOwnProperty.call(aicc_errors, String(errorCode))) { super( errorCode, aicc_errors[String(errorCode)].basicMessage, aicc_errors[String(errorCode)].detailMessage, ); } else { super( 101, aicc_errors["101"].basicMessage, aicc_errors["101"].detailMessage, ); } } }