<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Custom error handler for cli</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/25832/custom-error-handler-for-cli</link><description>In this file: components/libraries/cli/uart/nrf_cli_uart.c 
 The function as defined: 
 static void uart_error_handle(app_uart_evt_t * p_event)
{
 if (p_event-&amp;gt;evt_type == APP_UART_COMMUNICATION_ERROR)
 {
 APP_ERROR_HANDLER(p_event-&amp;gt;data.error_communication</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 11 Oct 2017 20:54:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/25832/custom-error-handler-for-cli" /><item><title>RE: Custom error handler for cli</title><link>https://devzone.nordicsemi.com/thread/101756?ContentTypeID=1</link><pubDate>Wed, 11 Oct 2017 20:54:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56cc978e-31bd-4a33-90eb-affe074c2951</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Yes, you should avoid modifying the &amp;quot;base&amp;quot; components/libraries/*. Usually the different libraries found in  &lt;code&gt;components/libraries&lt;/code&gt;  does not use the &lt;code&gt;APP_ERROR_HANDLER()&lt;/code&gt;, but will return the error_code to the higher level code, where the event_handler / error_handler is declared(e.g. in main.c).&lt;/p&gt;
&lt;p&gt;Please note that the nrf_cli_uart.c is reworked in SDK 14, and no longer uses the &lt;code&gt;APP_ERROR_HANDLER()&lt;/code&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom error handler for cli</title><link>https://devzone.nordicsemi.com/thread/101755?ContentTypeID=1</link><pubDate>Wed, 11 Oct 2017 16:13:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c20a9f43-d845-482f-8eed-81c0f4512e91</guid><dc:creator>pctj101</dc:creator><description>&lt;p&gt;Hi Sigurd, thanks for your note.  I was trying to avoid modifying the &amp;quot;base&amp;quot; components/libraries/* code.&lt;/p&gt;
&lt;p&gt;Is it typical to dive into sdk/components/* and modify code there directly when trying to handle errors?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom error handler for cli</title><link>https://devzone.nordicsemi.com/thread/101754?ContentTypeID=1</link><pubDate>Wed, 11 Oct 2017 09:22:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b74b6c69-59a9-4daa-8882-4f29870bf519</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;See &lt;a href="https://devzone.nordicsemi.com/question/168726/gracefully-handling-sdk-errors/?answer=168871#post-id-168871"&gt;this answer&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you want to handle the e.g. the event APP_UART_COMMUNICATION_ERROR in a different way, you need to do this yourself in the uart_error_handle() directly.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;if (p_event-&amp;gt;evt_type == APP_UART_COMMUNICATION_ERROR)
{
    //Your custom code on how to handle this error
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>