Issue with error handling not being triggered when calling SAPUI5 function()

IBAN validation within a SAPUI5 Wizard is causing some issues for me. I am utilizing a functionImport on a V2 ODataModel (sap.ui.model.odata.v2.ODataModel) to perform this validation.
Despite receiving a 202 status code, the request actually failed. Here is the response from the Firefox Network tab:

--1D57E7CB0DD73AB15048B36CC96993D60
Content-Type: multipart/mixed; boundary=1D57E7CB0DD73AB15048B36CC96993D61
Content-Length:         1303

--1D57E7CB0DD73AB15048B36CC96993D61
Content-Type: application/http
Content-Length: 1134
content-transfer-encoding: binary

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 950
dataserviceversion: 1.0
cache-control: no-cache, no-store
pragma: no-cache
content-id: id-1687346500037-256

{"d":{"CheckIBAN":{"__metadata":{"type":"XXXX"},"AccountID":"XXXXXX","IBAN":"DEXXXX","BankID":"","WithInOutPayment":true,"SepaNotifText":"XXX"}}}
--1D57E7CB0DD73AB15048B36CC96993D61--

--1D57E7CB0DD73AB15048B36CC96993D60
Content-Type: application/http
Content-Length: 1111
content-transfer-encoding: binary

HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=utf-8
Content-Length: 991
dataserviceversion: 1.0

{"error":{"code":"XXX/076","message":{"lang":"de","value":"XXX"},"innererror":{"application":{"component_id":"XXX","service_namespace":"XXX","service_id":"XXXX","service_version":"0001"},"transactionid":"XXX","timestamp":"XXX","Error_Resolution":{"SAP_Transaction":"XXX","SAP_Note":"XXXX"},"errordetails":[{"code":"XXX/076","message":"XXX","propertyref":"","severity":"error","target":""}]}}}
--1D57E7CB0DD73AB15048B36CC96993D60--

(Confidential information has been hidden) The browser console displays the following result: https://i.stack.imgur.com/Hko0l.png
It seems like registration of some sort is required. Below is the code where the callback was registered:

this.SERVICE.functionImport("CheckIBAN", XXX.Constants.HTTP_POST, XXX, true, {
            fnSuccess: jQuery.proxy(function (oData) {
                fnCallback(oData);
            }, this),
            fnError: fnError
        });

Keep in mind that the functionImport function acts as a wrapper for sap.ui.model.odata.v2.ODataModel.callFunction and performs the same task.
Irrespective of input (correct or incorrect), the fnSuccess is always triggered.
On the other hand, when using the read function of the ODataModel (simple GET request), everything works smoothly and triggers fnError upon encountering an error.

Answer №1

Your query seems to be missing a question mark "?"

If I understand correctly, you are wondering why the term "error" is not being triggered?

The term "error" is invoked when there is a failure in the http request. In the case of using batch operations, any errors within a changeset are not handled by this particular API... It appears that the implementation of UI5 v2 may not be as seamless as desired....

For further reference, please visit: https://github.com/SAP/openui5/issues/1382#issuecomment-288723906

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Unable to use href attribute as intended

HTML: <a id="Switch">Click here to switch</a> <a href="image1_large.png" class="mainA blade"> <img id="mainImage" src="image1.png"/></a> Javascript: <script> $(function() { $('#Switch').click(functio ...

Unable to access path for children through buttons in parent path

As a data scientist entering the world of frontend development, I find myself faced with the task of creating a UI at the request of my boss. Please bear with me as I attempt to explain my issue in layman's terms. Currently, I am using Vue.js and hav ...

How can Angular hide a global component when a particular route is accessed?

Is it possible to hide a global component in Angular when a specific route is opened? For instance, consider the following code: app.component.html <app-header></app-header> <app-banner></app-banner> <!-- Global Component I w ...

Converting data to JSON geometry format for implementation in Three.js

Currently, I am in the process of creating an exporter using Maxscript to convert data into JSON format for use in Three.js. Information on this topic is scarce, but I did come across a helpful resource: https://github.com/mrdoob/three.js/wiki/JSON-Geometr ...

What could be the reason for not receiving any response from my Firestore query?

Hey there! I'm delving into the world of Firebase for the first time and just set up the Firestore emulator. I've added some data that I want to fetch in my Nextjs app. Once I initialized firebase, this is what my component code looks like: funct ...

Ways to conceal components of an external widget on my site

I'm attempting to add a chat widget to my website and I'm looking to hide specific elements within the widget. The chat function is provided by Tidio, but I believe this applies to most widgets. My main goal is to conceal a button that minimize ...

When implementing ReplaySubject in Angular for a PUT request, the issue of data loss arises

I seem to be encountering a problem with the ReplaySubject. I can't quite pinpoint what I've done wrong, but the issue is that whenever I make a change and save it in the backend, the ReplaySubject fetches new data but fails to display it on the ...

The component fails to update even after changes are made to the Redux state

I currently have 4 buttons, each with a different color, and I want to display the last 10 button clicks as colors on 10 squares. The redux state is being used to map and display the square colors, which are also stored in localStorage. When a button is c ...

Form submissions are not saving checkbox answers

As a beginner, I'm struggling to save the checkbox answers on the page after submission. The code below is quite lengthy (checkboxes start at 314). I have a feeling that I might be missing a piece of code, but I just can't seem to pinpoint what i ...

Why opt for ref.current over directly applying the condition?

I'm curious as to why the code uses if (ref.current && !ref.current.contains(event.target)) rather than if (!ref.current.contains(event.target) function useOutsideAlerter(ref) { useEffect(() => { // Function for click event function hand ...

Retrieve Files with Angular Framework

I'm looking to implement a file download or view button using Angular without making a call to the backend. The file is static and the same for all users, so I want to avoid unnecessary server requests. Many solutions involve using the "download" att ...

developing a loading animation with progress indicator in CSS3

I have been working on creating a preloader, but I am having trouble embedding the percentage with the CSS circle. So far, I have tried various plugins without success. Can anyone help me with this issue? Here is my current progress. Below is the HTML co ...

Browser refresh not triggering view update in Rails and ReactJS application

Recently, I integrated Reactjs into my Rails application. Strangely, when I modify the content of a .jsx file and reload it with different text, such as changing from <h1>Hello<h1/> to <h1> Hello again<h1/>, the browser fails to res ...

Accessing the system through a pop-up window with the help of AJAX and

As a newcomer to the world of AJAX, I must admit that I may have jumped into this field with too much enthusiasm. For several days now, I have been struggling to integrate AJAX with my PHP script. Before dismissing this question as a duplicate, please unde ...

Imitate a HTTP request

Currently, I am working on developing a front-end application using Angular (although not crucial to this question). I have a service set up that currently supplies hard-coded JSON data. import { Injectable } from '@angular/core'; import { Obser ...

Dealing with null exceptions in Angular 4: Best practices

Hi there, I am encountering an issue with binding my model data to HTML fields where when I try to edit the data it returns an error saying "cannot read value of null". How can I resolve this? Here is the HTML code snippet: <div class="form-group"> ...

Is it possible to utilize JavaScript for displaying a continuous stream of images?

In this scenario, you are tasked with working with an image API and need to send a POST request to retrieve an image stream for display on the rest of your webpage. While I am able to use jQuery to make an ajax request to the service upon page load, I am ...

Jquery display function experiencing unresponsiveness

Currently, I am trying to implement some show/hide functionality in my JavaScript file: $(document).ready(function() { $('#me').hide(); $('#send').click(function() { $('#me').show("slow"); }); }); Strange ...

To achieve proper display of multiple boxes, it is essential for each box to be

My current approach involves adding boxes to the scene based on specific dimensions for height, width, and depth, and it works perfectly when the boxes are all square. https://i.sstatic.net/HdDSX.png However, the issue arises when I try to use a rectangu ...

Generate a variety of requests with Axios

I have a task where I need to send multiple Axios requests, but the number of requests can be completely random. It could range from 0 to even millions. Once all the requests are completed, I then need to perform an action, such as updating my state, which ...