MCPcopy Create free account
hub / github.com/microsoft/SandDance / _checkResponse

Function _checkResponse

docs/app/js/sanddance-app.js:55119–55141  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

55117 return _checkResponse.apply(this, arguments);
55118}
55119function _checkResponse() {
55120 _checkResponse = (0, _asyncToGeneratorDefault.default)((0, _regeneratorDefault.default).mark(function _callee2(response) {
55121 var message;
55122 return (0, _regeneratorDefault.default).wrap(function _callee2$(_context2) {
55123 while(true)switch(_context2.prev = _context2.next){
55124 case 0:
55125 if (response.ok) {
55126 _context2.next = 5;
55127 break;
55128 }
55129 _context2.next = 3;
55130 return getResponseError(response);
55131 case 3:
55132 message = _context2.sent;
55133 throw new Error(message);
55134 case 5:
55135 case "end":
55136 return _context2.stop();
55137 }
55138 }, _callee2);
55139 }));
55140 return _checkResponse.apply(this, arguments);
55141}
55142function checkResponseSync(response) {
55143 if (!response.ok) {
55144 var message = "".concat(response.status, " ").concat(response.statusText);

Callers

nothing calls this directly

Calls 1

getResponseErrorFunction · 0.70

Tested by

no test coverage detected