UNPKG

futoin-asyncsteps

Version:

Mimic traditional threads in single threaded event loop

140 lines (137 loc) 5.2 kB
"use strict"; /** * @file * @author Andrey Galkin <andrey@futoin.org> * * * Copyright 2014-2017 FutoIn Project (https://futoin.org) * Copyright 2014-2017 Andrey Galkin <andrey@futoin.org> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } var error_list = ['ConnectError', 'CommError', 'UnknownInterface', 'NotSupportedVersion', 'NotImplemented', 'Unauthorized', 'InternalError', 'InvokerError', 'InvalidRequest', 'DefenseRejected', 'PleaseReauth', 'SecurityError', 'Timeout', 'LoopBreak', 'LoopCont']; /** * List of standard FutoIn Core errors. It may static get extended in runtime. * @namespace FutoInErrors */ var Errors = /*#__PURE__*/_createClass(function Errors() { _classCallCheck(this, Errors); }); /** * Connection error before request is sent. * Must be generated on Invoker side * @constant {string} ConnectError * @memberof FutoInErrors */ /** * Communication error at any stage after request is sent * and before response is received. * Must be generated on Invoker side * @constant {string} CommError * @memberof FutoInErrors */ /** * Unknown interface requested. * Must be generated only on Executor side * @constant {string} UnknownInterface * @memberof FutoInErrors */ /** * Not supported interface version. * Must be generated only on Executor side * @constant {string} NotSupportedVersion * @memberof FutoInErrors */ /** * In case interface function is not implemented on Executor side * Must be generated on Executor side * @constant {string} NotImplemented * @memberof FutoInErrors */ /** * Security policy on Executor side does not allow to * access interface or specific function. * Must be generated only on Executor side * @constant {string} Unauthorized * @memberof FutoInErrors */ /** * Unexpected internal error on Executor side, including internal CommError. * Must be generated only on Executor side * @constant {string} InternalError * @memberof FutoInErrors */ /** * Unexpected internal error on Invoker side, not related to CommError. * Must be generated only on Invoker side * @constant {string} InvokerError * @memberof FutoInErrors */ /** * Invalid data is passed as FutoIn request. * Must be generated only on Executor side * @constant {string} InvalidRequest * @memberof FutoInErrors */ /** * Defense system has triggered rejection * Must be generated on Executor side, but also possible to be triggered on Invoker * @constant {string} DefenseRejected * @memberof FutoInErrors */ /** * Executor requests re-authorization * Must be generated only on Executor side * @constant {string} PleaseReauth * @memberof FutoInErrors */ /** * 'sec' request section has invalid data or not SecureChannel * Must be generated only on Executor side * @constant {string} SecurityError * @memberof FutoInErrors */ /** * Timeout occurred in any stage * Must be used only internally and should never travel in request message * @constant {string} Timeout * @memberof FutoInErrors */ /** * Loop Break called * Must not be used directly. * @constant {string} LoopBreak * @private * @memberof FutoInErrors */ /** * Loop Continue called * Must not be used directly. * @constant {string} LoopCont * @private * @memberof FutoInErrors */ error_list.forEach(function (v) { return Object.defineProperty(Errors, v, { enumerable: true, value: v }); }); module.exports = Errors; //# sourceMappingURL=Errors.js.map