Skip to content

Commit

Permalink
fallback to passing response in argument if response.body is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
ZenMasterJacob20011 committed Jun 3, 2024
1 parent 74ac883 commit 4b60c96
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/sdk/Formio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1566,13 +1566,13 @@ export class Formio {
if (!response.ok) {
if (response.status === 440) {
Formio.setToken(null, opts);
Formio.events.emit('formio.sessionExpired', response.body);
Formio.events.emit('formio.sessionExpired', response.body || response);
}
else if (response.status === 401) {
Formio.events.emit('formio.unauthorized', response.body);
Formio.events.emit('formio.unauthorized', response.body || response);
}
else if (response.status === 416) {
Formio.events.emit('formio.rangeIsNotSatisfiable', response.body);
Formio.events.emit('formio.rangeIsNotSatisfiable', response.body || response);
}
else if (response.status === 504) {
return Promise.reject(new Error('Network request failed'));
Expand Down

0 comments on commit 4b60c96

Please sign in to comment.