Skip to content

Commit 240e536

Browse files
authored
Merge pull request #10886 from adellape/custom_error_apb
Add custom error msg for APB
2 parents af35cf8 + dde9382 commit 240e536

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

apb_devel/writing/reference.adoc

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -821,3 +821,45 @@ mounted into a pod as a volume:
821821
- key: haste-config
822822
path: config.js
823823
----
824+
825+
[[apb-devel-writing-ref-custom-error-msg]]
826+
== Customizing Error Messages
827+
828+
A default error message is returned in the web console when a provision call
829+
fails. For example:
830+
831+
----
832+
Error occurred during provision. Please contact administrator if the issue persists.
833+
----
834+
835+
To provide more information for troubleshooting purposes should a failure occur,
836+
you can write custom error messages for your APB that the web console can check
837+
for and return to the user.
838+
839+
Kubernetes allows pods to log fatal events to a termination log. The log file
840+
location is set by the `terminationMessagePath` field in a pod's specification
841+
and defaults to *_/dev/termination-log_*.
842+
843+
Starting in {product-title} 3.10, the broker now checks this termination log for
844+
any messages that have been written to the file and passes the content to the
845+
service catalog. The web console then displays any such messages found in the
846+
event of a failure.
847+
848+
[NOTE]
849+
====
850+
See
851+
link:https://kubernetes.io/docs/tasks/debug-application-cluster/determine-reason-pod-failure/[Kubernetes documentation] for more details on pod termination messages.
852+
====
853+
854+
The following is an example of how this can be done in an APB utilizing a
855+
CloudFormation template:
856+
857+
----
858+
- name: Writing Termination Message
859+
shell: echo "[CloudFormation Error] - {{ ansible_failed_result.msg }}" > /dev/termination-log
860+
861+
- fail: msg="[APB Failed Plain - '{{ _apb_plan_id }}'] "
862+
----
863+
864+
If an error occurs, this example custom message is written to the default
865+
termination log path before it fails the pod.

0 commit comments

Comments
 (0)