Skip to content

Commit 3c86d3c

Browse files
jaboehrihhund
authored andcommitted
support for 504 error codes
1 parent 9b77d72 commit 3c86d3c

5 files changed

Lines changed: 107 additions & 2 deletions

File tree

src/main/java/dev/dsf/bpe/CodeSystem.java

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,10 @@ public enum Concept
387387
"send-message-http-502",
388388
"Sending a message to the remote instance resulted in HTTP status 502"
389389
),
390+
SEND_MESSAGE_HTTP_504(
391+
"send-message-http-504",
392+
"Sending a message to the remote instance resulted in HTTP status 504"
393+
),
390394
SEND_MESSAGE_HTTP_UNEXPECTED(
391395
"send-message-http-unexpected",
392396
"Sending a message to the remote instance resulted in an unexpected HTTP status code"
@@ -428,6 +432,10 @@ public enum Concept
428432
"receive-message-http-502",
429433
"Received a message and responded with HTTP status 502"
430434
),
435+
RECEIVE_MESSAGE_HTTP_504(
436+
"receive-message-http-504",
437+
"Received a message and responded with HTTP status 504"
438+
),
431439
RECEIVE_MESSAGE_HTTP_UNEXPECTED(
432440
"receive-message-http-unexpected",
433441
"Received a message and responded with an unexpected HTTP status code"
@@ -477,6 +485,10 @@ public enum Concept
477485
"local-binary-delete-http-502",
478486
"Local instance encountered a HTTP status 502 trying to clean up the binary resource"
479487
),
488+
LOCAL_BINARY_DELETE_HTTP_504(
489+
"local-binary-delete-http-504",
490+
"Local instance encountered a HTTP status 504 trying to clean up the binary resource"
491+
),
480492
LOCAL_BINARY_DELETE_HTTP_UNEXPECTED(
481493
"local-binary-delete-http-unexpected",
482494
"Local instance encountered an unexpected HTTP status code trying to clean up the binary resource"
@@ -510,6 +522,10 @@ public enum Concept
510522
"remote-binary-delete-http-502",
511523
"Remote instance encountered a HTTP status 502 trying to clean up the binary resource"
512524
),
525+
REMOTE_BINARY_DELETE_HTTP_504(
526+
"remote-binary-delete-http-504",
527+
"Remote instance encountered a HTTP status 504 trying to clean up the binary resource"
528+
),
513529
REMOTE_BINARY_DELETE_HTTP_UNEXPECTED(
514530
"remote-binary-delete-http-unexpected",
515531
"Remote instance encountered an unexpected HTTP status code trying to clean up the binary resource"
@@ -535,6 +551,10 @@ public enum Concept
535551
"local-binary-post-http-502",
536552
"Local instance encountered a HTTP status 502 trying to post the binary resource to its own FHIR server"
537553
),
554+
LOCAL_BINARY_POST_HTTP_504(
555+
"local-binary-post-http-504",
556+
"Local instance encountered a HTTP status 504 trying to post the binary resource to its own FHIR server"
557+
),
538558
LOCAL_BINARY_POST_HTTP_UNEXPECTED(
539559
"local-binary-post-http-unexpected",
540560
"Local instance encountered an unexpected HTTP status code trying to post the binary resource to its own FHIR server"
@@ -572,6 +592,10 @@ public enum Concept
572592
"remote-binary-post-http-502",
573593
"Remote instance encountered a HTTP status 502 trying to post the binary resource to its own FHIR server"
574594
),
595+
REMOTE_BINARY_POST_HTTP_504(
596+
"remote-binary-post-http-504",
597+
"Remote instance encountered a HTTP status 504 trying to post the binary resource to its own FHIR server"
598+
),
575599
REMOTE_BINARY_POST_HTTP_UNEXPECTED(
576600
"remote-binary-post-http-unexpected",
577601
"Remote instance encountered an unexpected HTTP status code trying to post the binary resource to its own FHIR server"
@@ -626,6 +650,10 @@ public enum Concept
626650
"response-message-timeout-http-502",
627651
"Response message timed out. Received HTTP status 502 trying to check request status on the target"
628652
),
653+
RESPONSE_MESSAGE_TIMEOUT_HTTP_504(
654+
"response-message-timeout-http-504",
655+
"Response message timed out. Received HTTP status 504 trying to check request status on the target"
656+
),
629657
RESPONSE_MESSAGE_TIMEOUT_HTTP_UNEXPECTED(
630658
"response-message-timeout-http-unexpected",
631659
"Response message timed out. Received an unexpected HTTP status code trying to check request status on the target"
@@ -654,7 +682,11 @@ public enum Concept
654682
),
655683
LOCAL_BINARY_DOWNLOAD_HTTP_502(
656684
"local-binary-download-http-502",
657-
"Local instance received HTTP status 500 trying to download the binary resource from the target"
685+
"Local instance received HTTP status 502 trying to download the binary resource from the target"
686+
),
687+
LOCAL_BINARY_DOWNLOAD_HTTP_504(
688+
"local-binary-download-http-504",
689+
"Local instance received HTTP status 504 trying to download the binary resource from the target"
658690
),
659691
LOCAL_BINARY_DOWNLOAD_HTTP_UNEXPECTED(
660692
"local-binary-download-http-unexpected",
@@ -697,6 +729,10 @@ public enum Concept
697729
"remote-binary-download-http-502",
698730
"Remote instance received HTTP status 502 trying to download the binary resource from this server"
699731
),
732+
REMOTE_BINARY_DOWNLOAD_HTTP_504(
733+
"remote-binary-download-http-504",
734+
"Remote instance received HTTP status 504 trying to download the binary resource from this server"
735+
),
700736
REMOTE_BINARY_DOWNLOAD_HTTP_UNEXPECTED(
701737
"remote-binary-download-http-unexpected",
702738
"Remote instance received an unexpected HTTP status trying to download the binary resource from this server"

src/main/java/dev/dsf/bpe/service/GenerateAndStoreResource.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ public void doExecuteWithErrorHandling(DelegateExecution delegateExecution, Vari
111111
errorRemote = new ProcessError(process, CodeSystem.DsfPingError.Concept.REMOTE_BINARY_POST_HTTP_502,
112112
ConstantsPing.POTENTIAL_FIX_URL_ERROR_HTTP);
113113
break;
114+
case 504:
115+
error = new ProcessError(process, CodeSystem.DsfPingError.Concept.LOCAL_BINARY_POST_HTTP_504,
116+
ConstantsPing.POTENTIAL_FIX_URL_ERROR_HTTP);
117+
errorRemote = new ProcessError(process, CodeSystem.DsfPingError.Concept.REMOTE_BINARY_POST_HTTP_504,
118+
ConstantsPing.POTENTIAL_FIX_URL_ERROR_HTTP);
119+
break;
114120
default:
115121
error = new ProcessError(process, CodeSystem.DsfPingError.Concept.LOCAL_BINARY_POST_HTTP_UNEXPECTED,
116122
ConstantsPing.POTENTIAL_FIX_URL_ERROR_HTTP);

src/main/java/dev/dsf/bpe/util/BinaryResourceDownloader.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,13 @@ public DownloadResult download(Variables variables, ProcessPluginApi api, Task t
127127
CodeSystem.DsfPingError.Concept.REMOTE_BINARY_DOWNLOAD_HTTP_502,
128128
ConstantsPing.POTENTIAL_FIX_URL_ERROR_HTTP);
129129
break;
130+
case 504:
131+
error = new ProcessError(process, CodeSystem.DsfPingError.Concept.LOCAL_BINARY_DOWNLOAD_HTTP_504,
132+
ConstantsPing.POTENTIAL_FIX_URL_ERROR_HTTP);
133+
errorRemote = new ProcessError(process,
134+
CodeSystem.DsfPingError.Concept.REMOTE_BINARY_DOWNLOAD_HTTP_504,
135+
ConstantsPing.POTENTIAL_FIX_URL_ERROR_HTTP);
136+
break;
130137
default:
131138
error = new ProcessError(process,
132139
CodeSystem.DsfPingError.Concept.LOCAL_BINARY_DOWNLOAD_HTTP_UNEXPECTED, null);

src/main/java/dev/dsf/bpe/util/task/SendTaskErrorConverter.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,11 @@ yield new ProcessErrorWithStatusCode(
315315
CodeSystem.DsfPingError.Concept.SEND_MESSAGE_HTTP_502,
316316
ConstantsPing.POTENTIAL_FIX_URL_ERROR_HTTP),
317317
CodeSystem.DsfPingStatus.Code.NOT_REACHABLE);
318+
case 504 -> new ProcessErrorWithStatusCode(
319+
new ProcessError(ConstantsPing.PROCESS_NAME_PING,
320+
CodeSystem.DsfPingError.Concept.SEND_MESSAGE_HTTP_504,
321+
ConstantsPing.POTENTIAL_FIX_URL_ERROR_HTTP),
322+
CodeSystem.DsfPingStatus.Code.NOT_REACHABLE);
318323
default -> new ProcessErrorWithStatusCode(
319324
new ProcessError(ConstantsPing.PROCESS_NAME_PING,
320325
CodeSystem.DsfPingError.Concept.SEND_MESSAGE_HTTP_UNEXPECTED, null),
@@ -356,6 +361,11 @@ yield new ProcessErrorWithStatusCode(
356361
CodeSystem.DsfPingError.Concept.RECEIVE_MESSAGE_HTTP_502,
357362
ConstantsPing.POTENTIAL_FIX_URL_ERROR_HTTP),
358363
CodeSystem.DsfPingStatus.Code.NOT_REACHABLE);
364+
case 504 -> new ProcessErrorWithStatusCode(
365+
new ProcessError(ConstantsPing.PROCESS_NAME_PING,
366+
CodeSystem.DsfPingError.Concept.RECEIVE_MESSAGE_HTTP_504,
367+
ConstantsPing.POTENTIAL_FIX_URL_ERROR_HTTP),
368+
CodeSystem.DsfPingStatus.Code.NOT_REACHABLE);
359369
default -> new ProcessErrorWithStatusCode(
360370
new ProcessError(ConstantsPing.PROCESS_NAME_PING,
361371
CodeSystem.DsfPingError.Concept.RECEIVE_MESSAGE_HTTP_UNEXPECTED, null),
@@ -389,6 +399,11 @@ else if (ConstantsPing.PROCESS_NAME_PONG.equals(process))
389399
CodeSystem.DsfPingError.Concept.SEND_MESSAGE_HTTP_502,
390400
ConstantsPing.POTENTIAL_FIX_URL_ERROR_HTTP),
391401
CodeSystem.DsfPingStatus.Code.NOT_REACHABLE);
402+
case 504 -> new ProcessErrorWithStatusCode(
403+
new ProcessError(ConstantsPing.PROCESS_NAME_PONG,
404+
CodeSystem.DsfPingError.Concept.SEND_MESSAGE_HTTP_504,
405+
ConstantsPing.POTENTIAL_FIX_URL_ERROR_HTTP),
406+
CodeSystem.DsfPingStatus.Code.NOT_REACHABLE);
392407
default -> new ProcessErrorWithStatusCode(
393408
new ProcessError(ConstantsPing.PROCESS_NAME_PONG,
394409
CodeSystem.DsfPingError.Concept.SEND_MESSAGE_HTTP_UNEXPECTED, null),
@@ -416,6 +431,11 @@ else if (ConstantsPing.PROCESS_NAME_PONG.equals(process))
416431
CodeSystem.DsfPingError.Concept.RECEIVE_MESSAGE_HTTP_502,
417432
ConstantsPing.POTENTIAL_FIX_URL_ERROR_HTTP),
418433
CodeSystem.DsfPingStatus.Code.NOT_REACHABLE);
434+
case 504 -> new ProcessErrorWithStatusCode(
435+
new ProcessError(ConstantsPing.PROCESS_NAME_PONG,
436+
CodeSystem.DsfPingError.Concept.RECEIVE_MESSAGE_HTTP_504,
437+
ConstantsPing.POTENTIAL_FIX_URL_ERROR_HTTP),
438+
CodeSystem.DsfPingStatus.Code.NOT_REACHABLE);
419439
default -> new ProcessErrorWithStatusCode(
420440
new ProcessError(ConstantsPing.PROCESS_NAME_PONG,
421441
CodeSystem.DsfPingError.Concept.RECEIVE_MESSAGE_HTTP_UNEXPECTED, null),

src/main/resources/fhir/CodeSystem/dsf-ping-error.xml

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@
4141
<code value="send-message-http-502"/>
4242
<display value="Sending a message to the remote instance resulted in HTTP status 502"/>
4343
</concept>
44+
<concept>
45+
<code value="send-message-http-504"/>
46+
<display value="Sending a message to the remote instance resulted in HTTP status 504"/>
47+
</concept>
4448
<concept>
4549
<code value="send-message-http-unexpected"/>
4650
<display value="Sending a message to the remote instance resulted in an unexpected HTTP status code"/>
@@ -83,6 +87,10 @@
8387
<code value="receive-message-http-502"/>
8488
<display value="Received a message and responded with HTTP status 502"/>
8589
</concept>
90+
<concept>
91+
<code value="receive-message-http-504"/>
92+
<display value="Received a message and responded with HTTP status 504"/>
93+
</concept>
8694
<concept>
8795
<code value="receive-message-http-unexpected"/>
8896
<display value="Received a message and responded with an unexpected HTTP status code"/>
@@ -132,6 +140,10 @@
132140
<code value="local-binary-delete-http-502"/>
133141
<display value="Local instance encountered a HTTP status 502 trying to clean up the binary resource"/>
134142
</concept>
143+
<concept>
144+
<code value="local-binary-delete-http-504"/>
145+
<display value="Local instance encountered a HTTP status 504 trying to clean up the binary resource"/>
146+
</concept>
135147
<concept>
136148
<code value="local-binary-delete-http-unexpected"/>
137149
<display value="Local instance encountered an unexpected HTTP status code trying to clean up the binary resource"/>
@@ -165,6 +177,10 @@
165177
<code value="remote-binary-delete-http-502"/>
166178
<display value="Remote instance encountered a HTTP status 502 trying to clean up the binary resource"/>
167179
</concept>
180+
<concept>
181+
<code value="remote-binary-delete-http-504"/>
182+
<display value="Remote instance encountered a HTTP status 504 trying to clean up the binary resource"/>
183+
</concept>
168184
<concept>
169185
<code value="remote-binary-delete-http-unexpected"/>
170186
<display value="Remote instance encountered an unexpected HTTP status code trying to clean up the binary resource"/>
@@ -190,6 +206,10 @@
190206
<code value="local-binary-post-http-502"/>
191207
<display value="Local instance encountered a HTTP status 502 trying to post the binary resource to its own FHIR server"/>
192208
</concept>
209+
<concept>
210+
<code value="local-binary-post-http-504"/>
211+
<display value="Local instance encountered a HTTP status 504 trying to post the binary resource to its own FHIR server"/>
212+
</concept>
193213
<concept>
194214
<code value="local-binary-post-http-unexpected"/>
195215
<display value="Local instance encountered an unexpected HTTP status code trying to post the binary resource to its own FHIR server"/>
@@ -227,6 +247,10 @@
227247
<code value="remote-binary-post-http-502"/>
228248
<display value="Remote instance encountered a HTTP status 502 trying to post the binary resource to its own FHIR server"/>
229249
</concept>
250+
<concept>
251+
<code value="remote-binary-post-http-504"/>
252+
<display value="Remote instance encountered a HTTP status 504 trying to post the binary resource to its own FHIR server"/>
253+
</concept>
230254
<concept>
231255
<code value="remote-binary-post-http-unexpected"/>
232256
<display value="Remote instance encountered an unexpected HTTP status code trying to post the binary resource to its own FHIR server"/>
@@ -281,6 +305,10 @@
281305
<code value="response-message-timeout-http-502"/>
282306
<display value="Response message timed out. Received HTTP status 502 trying to check request status on the target"/>
283307
</concept>
308+
<concept>
309+
<code value="response-message-timeout-http-504"/>
310+
<display value="Response message timed out. Received HTTP status 504 trying to check request status on the target"/>
311+
</concept>
284312
<concept>
285313
<code value="response-message-timeout-http-unexpected"/>
286314
<display value="Response message timed out. Received an unexpected HTTP status code trying to check request status on the target"/>
@@ -309,7 +337,11 @@
309337
</concept>
310338
<concept>
311339
<code value="local-binary-download-http-502"/>
312-
<display value="Local instance received HTTP status 500 trying to download the binary resource from the target"/>
340+
<display value="Local instance received HTTP status 502 trying to download the binary resource from the target"/>
341+
</concept>
342+
<concept>
343+
<code value="local-binary-download-http-504"/>
344+
<display value="Local instance received HTTP status 504 trying to download the binary resource from the target"/>
313345
</concept>
314346
<concept>
315347
<code value="local-binary-download-http-unexpected"/>
@@ -352,6 +384,10 @@
352384
<code value="remote-binary-download-http-502"/>
353385
<display value="Remote instance received HTTP status 502 trying to download the binary resource from this server"/>
354386
</concept>
387+
<concept>
388+
<code value="remote-binary-download-http-504"/>
389+
<display value="Remote instance received HTTP status 504 trying to download the binary resource from this server"/>
390+
</concept>
355391
<concept>
356392
<code value="remote-binary-download-http-unexpected"/>
357393
<display value="Remote instance received an unexpected HTTP status trying to download the binary resource from this server"/>

0 commit comments

Comments
 (0)