Skip to content

Commit

Permalink
feat(storage-client): error codes
Browse files Browse the repository at this point in the history
  • Loading branch information
AliMD committed Dec 17, 2022
1 parent 4a8200c commit fc5fe8a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/storage-client/src/storage-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export class AlwatrStorageClient<DocumentType extends AlwatrDocumentObject = Alw
});

if (typeof responseJson.data?.id !== 'string') {
this._logger.error('has', 'invalid_response_data', {responseJson});
this._logger.error('set', 'invalid_response_data', {responseJson});
throw new Error('invalid_response_data');
}

Expand Down Expand Up @@ -253,7 +253,7 @@ export class AlwatrStorageClient<DocumentType extends AlwatrDocumentObject = Alw
typeof responseJson.meta !== 'object' ||
typeof responseJson.meta.lastUpdated !== 'number'
) {
this._logger.error('has', 'invalid_response_data', {responseJson});
this._logger.error('getStorage', 'invalid_response_data', {responseJson});
throw new Error('invalid_response_data');
}

Expand Down Expand Up @@ -284,7 +284,7 @@ export class AlwatrStorageClient<DocumentType extends AlwatrDocumentObject = Alw
const keys = responseJson.data.keys;

if (!Array.isArray(keys)) {
this._logger.error('has', 'invalid_response_data', {responseJson});
this._logger.error('keys', 'invalid_response_data', {responseJson});
throw new Error('invalid_response_data');
}

Expand Down

0 comments on commit fc5fe8a

Please sign in to comment.