[4.2] - rbv_error_title is not defined - Portal

Posted by IramK on 05-Jul-2016 10:42

Hello,

I have a portal page and when I have an error on the portal page, it just gives a javascript error in the console:

Uncaught ReferenceError: rbv_error_title is not defined main.js:9 

There is no error pop-up being shown in portal pages to show what the error is. Looks like a bug to me. Please let me know when this would be fixed.

Cheers.

Iram

Posted by Mohammed Siraj on 04-Aug-2016 11:14

Yes Iram, such errors will also be reported in error callback handlers for public documented client-side API functions.

All Replies

Posted by IramK on 14-Jul-2016 09:03

Any possible fixes for this?

Posted by Santosh Patel on 15-Jul-2016 00:22

We have taken note and will confirm a fix release soon.

A workaround I can suggest for now would be to add the following custom script into your portal's Header and Footer config (Setup > Your Portal > More Actions > Header and Footer)

<script>
rbv_error_title = 'Error!'
rbv_warning_title = 'Warning!'
rbv_success_title = 'Success!'
rbv_information_title = 'Information!'
rbv_logicalCond_AND = 'AND'
rbv_logicalCond_OR = 'OR'
</script>

Only downside to this workaround is the text will not be localized. We will fix this as soon as possible.

Posted by IramK on 15-Jul-2016 10:13

Hello Santosh,

Will the error pop-ups be shown by this workaround?

Iram

Posted by IramK on 16-Jul-2016 04:26

Hello Santosh,

I have added that script but its still not showing the error pop-up. In order for me to see the actual error I need to refresh the page which is not good at all. Can you please try that out and provide a workaround for this as soon as possible.

Cheers.

Iram

Posted by IramK on 02-Aug-2016 05:58

Hello,

Any updates on this?

Posted by Mohammed Siraj on 03-Aug-2016 23:24

Hello Iram,

As communicated by Santosh earlier, this is a valid issue & we will be resolving it for 4.3.

For a temporary workaround, in case you are explicitly calling rbf_growl, ensure that you guard this function call within try/catch block. Calling this method is resulting in this exception and breaking your script.

Going forward we will also ensure that such errors are reported on browser console.

Regards,

Siraj.

Posted by IramK on 04-Aug-2016 03:14

Hello [mention:78c86023544844079dc6455a4a7a4d57:e9ed411860ed4f2ba0265705b8793d05] ,

Thanks for the update. Is there a way we can catch the error messages when they pop up? Say for example: If I have a selectQuery on change of a field and that query is incorrect, there is an error message that pops up. Is there a way to catch this? If there isn't, could you possibly provide support for this in 4.3?

Also what's the release date for 4.3?

Cheers.

Iram

Posted by Mohammed Siraj on 04-Aug-2016 03:31

Iram, for exception and errors generated in documented API functions, Rollbase will call an error handler function i.e. 'rbv_errorsCallback', if configured. That is, this function should be defined by end-users interested in error callbacks.

That is, once you define

rbv_errorsCallback = function(errorDetails,apiMethodName){

 alert('Error in: '+apiMethodName);

};

if there is an error while executing any documented API function like

rbv_api.selectQuery2, this error handler function will be called with error details.

Posted by IramK on 04-Aug-2016 03:35

Hello [mention:78c86023544844079dc6455a4a7a4d57:e9ed411860ed4f2ba0265705b8793d05] ,

Ok thats good to know, however what happens if there are platform errors like "API limit exceeded error"? Can we track that?

Cheers.

Iram

Posted by stayal on 04-Aug-2016 04:07

Hi IramK,

About the release date, its tentatively planned for the last week of august.

Regards,

Shivali

Posted by Mohammed Siraj on 04-Aug-2016 11:14

Yes Iram, such errors will also be reported in error callback handlers for public documented client-side API functions.

Posted by IramK on 09-Aug-2016 03:22

Hello Siraj,

Thanks for your reply. So once we do catch an error, is there a way we could stop the API functions from running again and again?

For Example:

1) If the SQL Query is too long, I would like to stop the selectQuery to run again and again and fire the same error_callback multiple times.

2) API Limit exceeded error: If the API limit has exceeded, I would like to stop the selectQuery to run again and again and fire the same error_callback multiple times.

Any suggestions?

Iram

Posted by Mohammed Siraj on 10-Aug-2016 13:53

Iram, on the client-page you can initialize a global variable to serve as a flag to indicate such a scenario and accordingly abort any following API calls (you might be doing in a loop construct).

Across the session, you can write and read the flag from HTML5 browser session storage. For which you can leverage the following API calls (available only in NewUI pages).

rb.newui.util.addToSessionStorage(storeKey, storeVal)

rb.newui.util.getFromSessionStorage(storeKey)

However, please avoid writing bulk information to sessionStorage as it is limited space per domain and may affect Platform behavior if exhausted.

Note: With the above API you can write and read JSON objects from session storage without requiring the overhead to convert them to/from Strings.

Posted by IramK on 10-Aug-2016 17:23

Hello [mention:78c86023544844079dc6455a4a7a4d57:e9ed411860ed4f2ba0265705b8793d05] ,

Thanks for the answer and the suggestion. There is only one issue in this case, I'm not on the NewUI pages. Its a portal page as mentioned in my question. So I don't think I'd be able to leverage the SessionStorage function. What do you suggest?

Cheers.

Iram

Posted by Mohammed Siraj on 10-Aug-2016 23:35

Right. The above mention function definitions are available only on a NewUI page.

However, these are just utility methods that internally leveragy HTML5 sessionSotrage API. You can very well consider using it directly. Here are some utility methods that you can add to your page:

function getFromSessionStorage(storeKey) {

       var storeVal = (storeKey && sessionStorage.getItem(String(storeKey))) || null;

       try {

           //will always JSON.stringify before adding to sessionStorage..

           storeVal = (storeVal !== null) ? JSON.parse(storeVal) : null;

       } catch (err) {

           storeVal = null;

       }

       return storeVal;

}

function addToSessionStorage (storeKey, storeVal) {

       storeKey = storeKey && String(storeKey);

       if (!storeKey || storeVal === undefined) {

           return;

       }

       try {

           sessionStorage.setItem(storeKey, JSON.stringify(storeVal));

       }

       catch (err) {

           console && console.error("[Error] Failed to update Session Storage " + err);

       }

}

Posted by IramK on 01-Nov-2016 18:30

This hasn't been fixed in neither Version 4.3 nor Version 4.4. The error message pop-up still doesn't show up in the portal pages when the API limit has been exceeded.

Iram

This thread is closed