Skip to content

Commit 7adcba3

Browse files
authored
s3: improve upstream internal error logging (#1676)
Closes getodk/central#1469
1 parent 30829c7 commit 7adcba3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/util/problem.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ const problems = {
255255

256256
s3accessDenied: problem(500.4, () => `The S3 account details or permissions are incorret.`),
257257

258-
s3upstreamError: problem(500.5, () => 'The upstream S3 server had an internal problem.'),
258+
s3upstreamError: problem(500.5, ({ amzRequestId, operation }) => `The upstream S3 server had an internal problem performing '${operation}'. Amazon request ID: '${amzRequestId}'.`),
259259

260260
// used to indicate missing odata functionality.
261261
notImplemented: problem(501.1, ({ feature }) => `The requested feature ${feature} is not supported by this server.`),

test/unit/external/s3.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ describe('external/s3', () => {
8989
() => s3.deleteObjsFor([ exampleBlob ]),
9090
{
9191
name: 'Error',
92-
message: 'The upstream S3 server had an internal problem.',
92+
message: `The upstream S3 server had an internal problem performing 'removeObjects'. Amazon request ID: 'tx000000000000000000000-0000000000-000000001-xxxxx'.`,
9393
problemCode: 500.5,
9494
problemDetails: {
9595
amzRequestId,
@@ -132,7 +132,7 @@ describe('external/s3', () => {
132132
() => s3.getContentFor(exampleBlob),
133133
{
134134
name: 'Error',
135-
message: 'The upstream S3 server had an internal problem.',
135+
message: `The upstream S3 server had an internal problem performing 'getObject'. Amazon request ID: 'tx000000000000000000000-0000000000-000000001-xxxxx'.`,
136136
problemCode: 500.5,
137137
problemDetails: {
138138
amzRequestId,
@@ -175,7 +175,7 @@ describe('external/s3', () => {
175175
() => s3.uploadFromBlob(exampleBlob),
176176
{
177177
name: 'Error',
178-
message: 'The upstream S3 server had an internal problem.',
178+
message: `The upstream S3 server had an internal problem performing 'putObject'. Amazon request ID: 'tx000000000000000000000-0000000000-000000001-xxxxx'.`,
179179
problemCode: 500.5,
180180
problemDetails: {
181181
amzRequestId,

0 commit comments

Comments
 (0)