diff --git a/core/storage-client/src/storage-client.ts b/core/storage-client/src/storage-client.ts index 85c47c655..53c9a274d 100644 --- a/core/storage-client/src/storage-client.ts +++ b/core/storage-client/src/storage-client.ts @@ -110,15 +110,23 @@ export class AlwatrStorageClient({ - ...this.fetchOption, - queryParameters: { - storage, - id: documentId, - }, - }) - ).data; + const responseJson = await serviceRequest({ + ...this.fetchOption, + queryParameters: { + storage, + id: documentId, + }, + }); + + if ( + typeof responseJson.data !== 'object' || + typeof responseJson.data.id !== 'string' + ) { + this._logger.error('get', 'invalid_response_data', {responseJson}); + throw new Error('invalid_response_data'); + } + + return responseJson.data; } /**