title: SAP HANA: how to catch SQL exception in procedure thrown by nested procedure?
body: <p>I have a SQL procedure which throws an exception in particular cases:</p>
  
  <pre><code>SIGNAL EMPTY_REQ_ATTR SET message_text = 'my mega error message';
  </code></pre>
  
  <p>This procedure has an exit handler:</p>
  
  <pre><code>DECLARE EMPTY_REQ_ATTR CONDITION;
  DECLARE EXIT HANDLER FOR EMPTY_REQ_ATTR RESIGNAL EMPTY_REQ_ATTR;
  </code></pre>
  
  <p>This SQL procedure is called in another SQL procedure where I try to catch this exception like this:</p>
  
  <pre><code>DECLARE EXIT HANDLER FOR SQLEXCEPTION
  BEGIN
      errors = SELECT 400 AS http_code, ::SQL_ERROR_MESSAGE AS message FROM dummy;
  END;
  </code></pre>
  
  <p>But in debug I see that exit handler only works in nested procedure. Breakpoint at <code>DECLARE EXIT HANDLER FOR SQLEXCEPTION</code> not working.</p>