EverydayTech Platform - Developer Reference
Complete Source Code Documentation - All Applications
Loading...
Searching...
No Matches
error.js
Go to the documentation of this file.
1/*
2 * Copyright (c) 2014-2015 Sylvain Peyrefitte
3 *
4 * This file is part of node-rdpjs.
5 *
6 * node-rdpjs is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20var inherits = require('util').inherits;
21
22/**
23 * Fatal error stop program
24 */
25function FatalError(message, code) {
26 Error.captureStackTrace(this);
27 this.message = message || "";
28 this.code = code || 'NODE_RDP_CORE_ERROR_NO_ERROR_CODE';
29}
30
31/**
32 * inherit from error
33 */
34inherits(FatalError, Error);
35
36/**
37 * Protocol error (non fatal);
38 */
39function ProtocolError(code, message) {
40 Error.captureStackTrace(this);
41 this.code = code;
42 this.message = message || "";
43}
44
45/**
46 * inherit from error
47 */
48inherits(ProtocolError, Error);
49
50/**
51 * ImplementationError error (non fatal);
52 */
53function ImplementationError(code, message) {
54 Error.captureStackTrace(this);
55 this.code = code;
56 this.message = message || "";
57}
58
59/**
60 * inherit from error
61 */
62inherits(ImplementationError, Error);
63
64/**
65 * Module exports
66 */
67module.exports = {
68 FatalError : FatalError,
69 ProtocolError : ProtocolError,
70 ImplementationError : ImplementationError
71};