33 lines
No EOL
1 KiB
JavaScript
33 lines
No EOL
1 KiB
JavaScript
"use strict";
|
|
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT License.
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.InvokeException = void 0;
|
|
/**
|
|
* A custom exception for invoke response errors.
|
|
*/
|
|
class InvokeException extends Error {
|
|
/**
|
|
* @param status The Http status code of the error.
|
|
* @param response optional. The body of the exception. Default is null.
|
|
*/
|
|
constructor(status, response) {
|
|
super();
|
|
this.status = status;
|
|
this.response = response;
|
|
this.name = 'InvokeException';
|
|
}
|
|
/**
|
|
* A factory method that creates a new [InvokeResponse](xref:botbuilder-core.InvokeResponse) object with the status code and body of the current object.
|
|
*
|
|
* @returns A new [InvokeResponse](xref:botbuilder-core.InvokeResponse) object.
|
|
*/
|
|
createInvokeResponse() {
|
|
return {
|
|
status: this.status,
|
|
body: this.response,
|
|
};
|
|
}
|
|
}
|
|
exports.InvokeException = InvokeException;
|
|
//# sourceMappingURL=invokeException.js.map
|