mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-20 07:43:12 +09:00
Port message types to TypeScript
This commit is contained in:
1 parent
15ea9a91dc
commit
2a52a82fb7
31 files changed
+2846
-4124
No files matched your search
@@ -176,10 +176,10 @@ export class Link {
|
||||
);
|
||||
|
||||
} else if (message.type === "response") {
|
||||
this._processResponse(message);
|
||||
this._processResponse(message as libData.MessageResponse);
|
||||
|
||||
} else if (message.type === "responseError") {
|
||||
this._processResponseError(message);
|
||||
this._processResponseError(message as libData.MessageResponseError);
|
||||
|
||||
} else if (message.type === "event") {
|
||||
this._processEvent(
|
||||
@@ -362,9 +362,13 @@ export class Link {
|
||||
} else if (!(err instanceof libErrors.RequestError)) {
|
||||
logger.error(`Unexpected error responding to ${message.name}:\n${err.stack}`);
|
||||
}
|
||||
this.connector.sendResponseError(
|
||||
new libData.ResponseError(err.message, err.code, err.stack), message.src, spoofedSrc
|
||||
);
|
||||
try {
|
||||
this.connector.sendResponseError(
|
||||
new libData.ResponseError(err.message, err.code, err.stack), message.src, spoofedSrc
|
||||
);
|
||||
} catch (err) {
|
||||
logger.error(`Unexpected error sending error response for ${message.name}:\n${err.stack}`);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user