This repository has been archived on 2019-05-14. You can view files and clone it, but cannot push or open issues or pull requests.
Typertext/lib/Typertext/BaseException.ts

53 lines
1.1 KiB
TypeScript
Raw Permalink Normal View History

2014-02-28 16:37:09 +00:00
/**
* @module Typertext
* @submodule Http
* @submodule Json
*/
2014-02-26 19:12:37 +00:00
module Typertext {
export class BaseException<T> {
private code:number;
private custom:T;
private message:string;
2014-02-28 16:37:09 +00:00
/**
* A simple utility class to provide a defined way to pass exceptions occurring within Typertext
*
* @param {string} message
* @param {number} code
* @param {T} custom
* @constructor
*/
2014-02-26 19:12:37 +00:00
constructor(message:string, code:number, custom:T) {
this.message = message;
this.code = code;
this.custom = custom;
}
2014-02-28 16:37:09 +00:00
/**
* Accessor method
*
* @returns {number}
*/
2014-02-26 19:12:37 +00:00
public GetCode():number {
return this.code;
}
2014-02-28 16:37:09 +00:00
/**
* Accessor method
*
* @returns {string}
*/
2014-02-26 19:12:37 +00:00
public GetMessage():string {
return this.message;
}
2014-02-28 16:37:09 +00:00
/**
* Accessor method
*
* @returns {T}
*/
2014-02-26 19:12:37 +00:00
public GetCustom():T {
return this.custom;
}
}
}