Skip to content

Commit 226f7e1

Browse files
committed
fix: update error messages in API response for file retrieval failures
1 parent fd5f968 commit 226f7e1

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/__tests__/routes.test.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ describe('API Routes', () => {
564564
.get('/v1/static/reports/data.json')
565565
.expect(500);
566566

567-
expect(res.body).toHaveProperty('error', 'Failed to retrieve file');
567+
expect(res.body).toHaveProperty('error', 'Server failed to respond');
568568
expect(res.body).toHaveProperty('details');
569569
});
570570

@@ -576,7 +576,8 @@ describe('API Routes', () => {
576576
.get('/v1/static/reports/data.json')
577577
.expect(500);
578578

579-
expect(res.body).toHaveProperty('error', 'Failed to retrieve file');
579+
expect(res.body).toHaveProperty('error', 'Server failed to respond');
580+
expect(res.body).toHaveProperty('details');
580581
});
581582

582583
it('should handle stream errors during file read', async () => {
@@ -852,7 +853,7 @@ describe('API Routes', () => {
852853
.get('/v1/static/reports/data.json')
853854
.expect(500);
854855

855-
expect(res.body).toHaveProperty('error', 'Failed to retrieve file');
856+
expect(res.body).toHaveProperty('error', 'Server failed to respond');
856857
expect(res.body).toHaveProperty('details');
857858
});
858859

@@ -864,7 +865,8 @@ describe('API Routes', () => {
864865
.get('/v1/static/reports/data.json')
865866
.expect(500);
866867

867-
expect(res.body).toHaveProperty('error', 'Failed to retrieve file');
868+
expect(res.body).toHaveProperty('error', 'Server failed to respond');
869+
expect(res.body).toHaveProperty('details');
868870
});
869871

870872
it('should handle stream errors during file read', async () => {

0 commit comments

Comments
 (0)