Skip to content

Commit 57f74e9

Browse files
authored
fix: Update GET proof record endpoint to return 404 for non-existing records (#1190)
Signed-off-by: Amr Mubarak <[email protected]>
1 parent 9890cdd commit 57f74e9

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

apps/verification/src/verification.service.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -187,17 +187,13 @@ export class VerificationService {
187187
return getProofPresentationById?.response;
188188
} catch (error) {
189189
this.logger.error(`[getProofPresentationById] - error in get proof presentation by proofId : ${JSON.stringify(error)}`);
190-
const errorStack = error?.response?.error?.reason;
190+
const errorMessage = error?.response?.error?.reason || error?.message;
191191

192-
if (errorStack) {
193-
throw new RpcException({
194-
message: ResponseMessages.verification.error.proofNotFound,
195-
statusCode: error?.response?.status,
196-
error: errorStack
197-
});
198-
} else {
199-
throw new RpcException(error.response ? error.response : error);
192+
if (errorMessage?.includes('not found')) {
193+
throw new NotFoundException(errorMessage);
200194
}
195+
196+
throw new RpcException(error.response ? error.response : error);
201197
}
202198
}
203199

0 commit comments

Comments
 (0)