feat: attempt more error parsing (#14899)

This commit is contained in:
Adam Weidman
2025-12-10 11:14:07 -08:00
committed by GitHub
parent c8b688655c
commit 22e6af414a
4 changed files with 100 additions and 25 deletions
+11 -2
View File
@@ -94,7 +94,12 @@ describe('parseGoogleApiError', () => {
},
},
};
expect(parseGoogleApiError(mockError)).toBeNull();
expect(parseGoogleApiError(mockError)).toEqual({
code: 400,
message: 'Bad Request',
details: [],
});
});
it('should return null if there are no valid details', () => {
@@ -115,7 +120,11 @@ describe('parseGoogleApiError', () => {
},
},
};
expect(parseGoogleApiError(mockError)).toBeNull();
expect(parseGoogleApiError(mockError)).toEqual({
code: 400,
message: 'Bad Request',
details: [],
});
});
it('should parse a doubly nested error in the message', () => {