<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Error Handling and Custom Messages in Workflows in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/error-handling-and-custom-messages-in-workflows/m-p/81580#M36346</link>
    <description>&lt;P&gt;What you can do is pass the custom error message you want from the notebook back to the workflow&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;output &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;f&lt;/SPAN&gt;&lt;SPAN&gt;"There was an error with {error_code} : {error_msg}&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;dbutils.notebook.&lt;/SPAN&gt;&lt;SPAN&gt;exit&lt;/SPAN&gt;&lt;SPAN&gt;(output)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;Then when you are fetching the status of your pipeline, you can also check the output of each task. You need to&amp;nbsp;loop through each task runid to get the individual outputs. You would use&amp;nbsp;&lt;A href="https://docs.databricks.com/api/workspace/jobs/getrunoutput" rel="nofollow noreferrer" target="_blank"&gt;jobs/runs/get-output&lt;/A&gt;&amp;nbsp;with run_id as a parameter. The run_id should be that of the task and not the job itself. Based on the output of the task, your pipeline can understand the custom error. You will find the output in a json variable called&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;notebook_output.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Fri, 02 Aug 2024 05:28:59 GMT</pubDate>
    <dc:creator>Edthehead</dc:creator>
    <dc:date>2024-08-02T05:28:59Z</dc:date>
    <item>
      <title>Error Handling and Custom Messages in Workflows</title>
      <link>https://community.databricks.com/t5/data-engineering/error-handling-and-custom-messages-in-workflows/m-p/81161#M36244</link>
      <description>&lt;P&gt;I would like to be able to get custom error's message ideally visible from Workflows &amp;gt; Jobs UI.&lt;/P&gt;&lt;P&gt;1. For example, workflow failed because file was missing and could not find it, in this case I am getting "Status" Failed and "Error Code" RunExecutionError. If I hove cursor on Status's red icon, I am able to see "[RunExecutionError] Workload failed, see run output for details". Is there anyway to have custom error there?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. I would like to use /api/2.1/jobs/runs/get to get some information about error. I did API call and check ['tasks'] key, but all somehow useful which I can see is 'result_state': TERMINATED, state_message = 'Workload failed, see run output for details'. Is it possible to have some custom parameter there which could indicate what error happen? I thought about tag but is it possible to create tag or any other variable while runing notebook task and then read it from runs/get API call?&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jul 2024 14:44:03 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/error-handling-and-custom-messages-in-workflows/m-p/81161#M36244</guid>
      <dc:creator>CaptainJack</dc:creator>
      <dc:date>2024-07-30T14:44:03Z</dc:date>
    </item>
    <item>
      <title>Re: Error Handling and Custom Messages in Workflows</title>
      <link>https://community.databricks.com/t5/data-engineering/error-handling-and-custom-messages-in-workflows/m-p/81210#M36252</link>
      <description>&lt;P class="_1t7bu9h1 paragraph"&gt;Custom error messages in the Workflows &amp;gt; Jobs UI or via the /api/2.1/jobs/runs/get API call are not directly supported. The error messages you're seeing, such as "RunExecutionError", are standard error codes that Databricks uses to indicate the type of error that occurred.&lt;/P&gt;
&lt;P class="_1t7bu9h1 paragraph"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jul 2024 18:04:14 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/error-handling-and-custom-messages-in-workflows/m-p/81210#M36252</guid>
      <dc:creator>Walter_C</dc:creator>
      <dc:date>2024-07-30T18:04:14Z</dc:date>
    </item>
    <item>
      <title>Re: Error Handling and Custom Messages in Workflows</title>
      <link>https://community.databricks.com/t5/data-engineering/error-handling-and-custom-messages-in-workflows/m-p/81259#M36257</link>
      <description>&lt;P&gt;Any idea for workaround? I thought about tagValue / jobValue as error but I am not sure if it is possible to get these using jobs/runs/get API. If it is really not possible, I am thinking about email notifications as last resort.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2024 07:16:54 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/error-handling-and-custom-messages-in-workflows/m-p/81259#M36257</guid>
      <dc:creator>CaptainJack</dc:creator>
      <dc:date>2024-07-31T07:16:54Z</dc:date>
    </item>
    <item>
      <title>Re: Error Handling and Custom Messages in Workflows</title>
      <link>https://community.databricks.com/t5/data-engineering/error-handling-and-custom-messages-in-workflows/m-p/81580#M36346</link>
      <description>&lt;P&gt;What you can do is pass the custom error message you want from the notebook back to the workflow&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;output &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;f&lt;/SPAN&gt;&lt;SPAN&gt;"There was an error with {error_code} : {error_msg}&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;dbutils.notebook.&lt;/SPAN&gt;&lt;SPAN&gt;exit&lt;/SPAN&gt;&lt;SPAN&gt;(output)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;Then when you are fetching the status of your pipeline, you can also check the output of each task. You need to&amp;nbsp;loop through each task runid to get the individual outputs. You would use&amp;nbsp;&lt;A href="https://docs.databricks.com/api/workspace/jobs/getrunoutput" rel="nofollow noreferrer" target="_blank"&gt;jobs/runs/get-output&lt;/A&gt;&amp;nbsp;with run_id as a parameter. The run_id should be that of the task and not the job itself. Based on the output of the task, your pipeline can understand the custom error. You will find the output in a json variable called&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;notebook_output.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 02 Aug 2024 05:28:59 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/error-handling-and-custom-messages-in-workflows/m-p/81580#M36346</guid>
      <dc:creator>Edthehead</dc:creator>
      <dc:date>2024-08-02T05:28:59Z</dc:date>
    </item>
  </channel>
</rss>

