1 /** 2 * @file Exceptions handler 3 * 4 * @author Dominik Kocuj 5 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 or later 6 * @copyright Copyright (c) 2016-2018 kocuj.pl 7 */ 8 9 (function() {})(); // empty function for correct minify with comments 10 //'use strict'; // for jshint uncomment this and comment line above 11 12 /* jshint strict: true */ 13 /* jshint -W034 */ 14 15 /* global kocujILV12aCException */ 16 /* global kocujPLV12aExceptionCode */ 17 18 /** 19 * Exception prototype constructor 20 * 21 * @constructs 22 * @namespace kocujPLV12aCException 23 * @public 24 * @param {number} [code] Error code 25 * @param {string} [filename] Filename with error 26 * @param {string} [param] Parameter for error information 27 * @return {void} 28 */ 29 function kocujPLV12aCException(code, filename, param) { 30 'use strict'; 31 /* jshint validthis: true */ 32 // get this object 33 var self = this; 34 // execute parent 35 kocujILV12aCException.call(self, code, filename, param); 36 } 37 38 // exception prototype 39 kocujPLV12aCException.prototype = new kocujILV12aCException(); 40 kocujPLV12aCException.prototype.constructor = kocujPLV12aCException; 41 42 /** 43 * Get exception name 44 * 45 * @private 46 * @return {string} Exception name 47 */ 48 kocujPLV12aCException.prototype._getExceptionName = function() { 49 'use strict'; 50 // exit 51 return 'kocujpllibv12a'; 52 }; 53 54 /** 55 * Set errors codes and texts 56 * 57 * @private 58 * @return {void} 59 */ 60 kocujPLV12aCException.prototype._setErrors = function() { 61 'use strict'; 62 // set errors 63 var codes = kocujPLV12aExceptionCode; 64 this._errors[codes.OK] = 'OK'; 65 this._errors[codes.EMPTY_PROJECT_ID] = 'Empty project identifier'; 66 this._errors[codes.PROJECT_DOES_NOT_EXIST] = 'Project does not exist'; 67 this._errors[codes.PROJECT_ALREADY_EXISTS] = 'Project already exists'; 68 this._errors[codes.ADD_THANKS_EMPTY_WINDOW_FUNCTION] = 'Empty window function for add thanks script'; 69 this._errors[codes.ADD_THANKS_EMPTY_API_URL] = 'Empty API URL for add thanks script'; 70 this._errors[codes.ADD_THANKS_EMPTY_API_LOGIN] = 'Empty API login for add thanks script'; 71 }; 72