On application level there is an onError event. Can we use this event to trap the errors that are raised by Formspider and maybe show them in a different way then showing the little error button? Maybe trap them and display them in a popup dialog or on a panel somewhere?

Thanks, Michiel

asked 04 Jul '12, 14:22

Michiel%20A's gravatar image

Michiel A
accept rate: 13%

Hi Michiel,

Yes, onError event prevents the error icon to be shown. You can use your own error alert or panel to show the error message.

You can use api_exception.getException api in your onError action code to get the error details. Below is a sample onError procedure:

procedure onError is
  v_exception api_exception.t_exception;
  v_exception :=   api_exception.getexception();
  api_application.showpopupmessage('Error Message:'||v_exception.message_tx||chr(10)||
                                   /*Formspider api from which the error raised*/
                                   'Formspider API:'||v_exception.methodName_tx||chr(10)||
                                   /*Formspider exception code*/
                                   'Exception Code:'||v_exception.exceptionCode_tx );

answered 04 Jul '12, 22:56

Ugur%20Kocak's gravatar image

Ugur Kocak ♦
accept rate: 23%

edited 04 Jul '12, 22:58

Hi Ugur,

I tested this code and is does catch the the fact that an exception occurred in the Formspider API's. But if i raise an exception myself (raise e_some_exception) and write an error text with api_error.log, this code catches only that a user defined exception occurred, but does not show the api_error.log messages. In this case the error icon still appears, and when i click on the icon, the error text messages i logged do appear.

Is there any way to combine this, so that all errors raised are captured?

(05 Jul '12, 00:21) Michiel A

We can not track the name of the PL/SQL exception raised by the developer because of PL/SQL limitations. So the best way to handle your own exceptions in the onError is:

  • Define a global variable and set it just before raising the exception
  • In onError procedure, check if the exception code is 1 (which means ora-00001 - user defined exception), then check the global variable to understand if it is your own exception

PS: api_error.log causes error icon to be shown even onError is defined. If the above solution does not fit your needs we can update the api or create a new api?

(05 Jul '12, 03:10) Ugur Kocak ♦

I think i would like the onError trigger to catch all exceptions and at the same time display the api_error.log messages. That way you could have 1 central point where it all comes together. You could then for example if you want to raise an exception in your app, first log some explanation with api_error.log and then raise. Then the onError will show both the api_error.log messages and the exception itself (user defined exception..) I will put this on my list of issues to be discussed, thanks.

(05 Jul '12, 05:04) Michiel A

Hi Michiel,

I told to the team about api_error.log. We accept it is a bug. OnError event will also prevent api_error.log messages to appear on the UI. We will also implement a new api to get the api_error.log messages.

(06 Jul '12, 05:18) Ugur Kocak ♦

Hi Ugur, Great, thanks alot. Michiel

(06 Jul '12, 11:39) Michiel A
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 04 Jul '12, 14:22

Seen: 2,980 times

Last updated: 06 Jul '12, 11:39

© Copyright Gerger 2017