mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-21 05:20:24 +08:00
12 lines
332 B
TypeScript
12 lines
332 B
TypeScript
import * as httpAssert from 'http-assert';
|
|
import { HttpError } from 'http-errors';
|
|
|
|
try {
|
|
httpAssert.equal('hello', 'hello');
|
|
httpAssert(false, 401, 'authentication failed');
|
|
} catch (err) {
|
|
console.log((<HttpError> err).status);
|
|
console.log((<HttpError> err).message);
|
|
console.log((<HttpError> err).expose);
|
|
}
|