Skip to content

Commit

Permalink
Merge pull request #2712 from SuperITMan/bugfix/fix-persist-logging
Browse files Browse the repository at this point in the history
fix(stark-core): add support for http 204 status code when persisting logs
  • Loading branch information
SuperITMan authored May 10, 2021
2 parents 99a0664 + e24d92b commit 246751a
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,15 @@ export class StarkLoggingServiceImpl implements StarkLoggingService {

const emitXhrResult = (xhrRequest: XMLHttpRequest): void => {
if (xhrRequest.readyState === XMLHttpRequest.DONE) {
if (xhrRequest.status === StarkHttpStatusCodes.HTTP_200_OK || xhrRequest.status === StarkHttpStatusCodes.HTTP_201_CREATED) {
httpRequest$.next();
httpRequest$.complete();
} else {
httpRequest$.error(xhrRequest.status);
switch (xhrRequest.status) {
case StarkHttpStatusCodes.HTTP_200_OK:
case StarkHttpStatusCodes.HTTP_201_CREATED:
case StarkHttpStatusCodes.HTTP_204_NO_CONTENT:
httpRequest$.next();
httpRequest$.complete();
break;
default:
httpRequest$.error(xhrRequest.status);
}
}
};
Expand Down

0 comments on commit 246751a

Please sign in to comment.