Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
parent
93e3a48004
commit
b38dea0597
25901 changed files with 9982925 additions and 369 deletions
37
gaia/apps/calendar/js/common/error.js
Executable file
37
gaia/apps/calendar/js/common/error.js
Executable file
|
|
@ -0,0 +1,37 @@
|
|||
define(function(require, exports, module) {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* These errors are _not_ exceptions and are designed to be passed not thrown
|
||||
* in typical |throw new X| fashion.
|
||||
*/
|
||||
function Base(name, detail) {
|
||||
this.message = 'oops... why did you throw this?';
|
||||
this.name = name;
|
||||
this.detail = detail;
|
||||
}
|
||||
module.exports = Base;
|
||||
|
||||
Base.prototype = Object.create(Error.prototype);
|
||||
|
||||
function errorFactory(name, l10nID) {
|
||||
var error = function(detail) {
|
||||
this.name = name;
|
||||
this.detail = detail;
|
||||
/**
|
||||
* we need to use l10nID's for backwards compatibility
|
||||
* (not changing string IDs between releases).
|
||||
*/
|
||||
this.l10nID = l10nID || name;
|
||||
};
|
||||
|
||||
error.prototype = Object.create(Base.prototype);
|
||||
return error;
|
||||
}
|
||||
|
||||
/* note names should _never_ change */
|
||||
Base.Authentication = errorFactory('authentication', 'unauthenticated');
|
||||
Base.InvalidServer = errorFactory('invalid-server', 'internal-server-error');
|
||||
Base.ServerFailure = errorFactory('server-failure', 'internal-server-error');
|
||||
|
||||
});
|
||||
Loading…
Reference in a new issue