vscode-jsonrpc
Advanced tools
Comparing version 3.0.3 to 3.0.4
@@ -113,2 +113,20 @@ /// <reference path="thenable.d.ts" /> | ||
} | ||
export declare enum ConnectionErrors { | ||
/** | ||
* The connection is closed. | ||
*/ | ||
Closed = 1, | ||
/** | ||
* The connection got disposed. | ||
*/ | ||
Disposed = 2, | ||
/** | ||
* The connection is already in listening mode. | ||
*/ | ||
AlreadyListening = 3, | ||
} | ||
export declare class ConnectionError extends Error { | ||
readonly code: ConnectionErrors; | ||
constructor(code: ConnectionErrors, message: string); | ||
} | ||
export interface MessageConnection { | ||
@@ -115,0 +133,0 @@ sendRequest<R, E, RO>(type: RequestType0<R, E, RO>, token?: CancellationToken): Thenable<R>; |
@@ -7,2 +7,7 @@ /* -------------------------------------------------------------------------------------------- | ||
'use strict'; | ||
var __extends = (this && this.__extends) || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
var is = require("./is"); | ||
@@ -94,2 +99,28 @@ var messages_1 = require("./messages"); | ||
})(LogTraceNotification = exports.LogTraceNotification || (exports.LogTraceNotification = {})); | ||
var ConnectionErrors; | ||
(function (ConnectionErrors) { | ||
/** | ||
* The connection is closed. | ||
*/ | ||
ConnectionErrors[ConnectionErrors["Closed"] = 1] = "Closed"; | ||
/** | ||
* The connection got disposed. | ||
*/ | ||
ConnectionErrors[ConnectionErrors["Disposed"] = 2] = "Disposed"; | ||
/** | ||
* The connection is already in listening mode. | ||
*/ | ||
ConnectionErrors[ConnectionErrors["AlreadyListening"] = 3] = "AlreadyListening"; | ||
})(ConnectionErrors = exports.ConnectionErrors || (exports.ConnectionErrors = {})); | ||
var ConnectionError = (function (_super) { | ||
__extends(ConnectionError, _super); | ||
function ConnectionError(code, message) { | ||
var _this = _super.call(this, message) || this; | ||
_this.code = code; | ||
Object.setPrototypeOf(_this, ConnectionError.prototype); | ||
return _this; | ||
} | ||
return ConnectionError; | ||
}(Error)); | ||
exports.ConnectionError = ConnectionError; | ||
var ConnectionState; | ||
@@ -452,6 +483,6 @@ (function (ConnectionState) { | ||
if (isClosed()) { | ||
throw new Error('Connection is closed.'); | ||
throw new ConnectionError(ConnectionErrors.Closed, 'Connection is closed.'); | ||
} | ||
if (isDisposed()) { | ||
throw new Error('Connection is disposed.'); | ||
throw new ConnectionError(ConnectionErrors.Disposed, 'Connection is disposed.'); | ||
} | ||
@@ -461,3 +492,3 @@ } | ||
if (isListening()) { | ||
throw new Error('Connection is already listening'); | ||
throw new ConnectionError(ConnectionErrors.AlreadyListening, 'Connection is already listening'); | ||
} | ||
@@ -464,0 +495,0 @@ } |
{ | ||
"name": "vscode-jsonrpc", | ||
"description": "A json rpc implementation over streams", | ||
"version": "3.0.3", | ||
"version": "3.0.4", | ||
"author": "Microsoft Corporation", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
98013
2269