-
Notifications
You must be signed in to change notification settings - Fork 0
/
ErrorFactory.ts
35 lines (28 loc) · 1.06 KB
/
ErrorFactory.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
///<reference path='./Utils.ts' />
///<reference path='./LispTypes.ts' />
module ErrorFactory{
export function makeSyntaxError(msg : string, values? : Object) : SyntaxError
{
return new SyntaxError(Utils.substituteTemplate(msg, values));
}
export function makeEvalException(msg : string, values? : Object) : TSLisp.EvalException
{
return new TSLisp.EvalException(Utils.substituteTemplate(msg, values));
}
export function createEvalException(msg : string, expr? : any) : TSLisp.EvalException
{
return new TSLisp.EvalException(msg, expr);
}
export function makeTypeError(msg : string, values? : Object) : TypeError
{
return new TypeError(Utils.substituteTemplate(msg, values));
}
export function makeLispThrowException(tag, value) : TSLisp.LispThrowException
{
return new TSLisp.LispThrowException(tag, value);
}
export function makeError(msg : string, values? : Object) : Error
{
return new Error(Utils.substituteTemplate(msg, values));
}
}