Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Simone Chiaretta 135 posts 542 karma points c-trib
    Mar 03, 2016 @ 20:28
    Simone Chiaretta
    0

    Error Handler not called with umbRequestHelper.resourcePromise

    When I call the resourcePromise method and an error happens my error handler doesn't get called. What happens is that the side panel appears with the detail of the error returned by the server but my handler is not called.

    Am I doing something wrong or is there a bug somewhere?

    Here the code I'm using:

        umbRequestHelper.resourcePromise(
            $http.post("/umbraco/backoffice/api/XliffTranslation/post", args),
            'Failed to request translation for content')
            .then(function (data) {
                $scope.error = false;
                $scope.success = true;
                $scope.busy = false;
                $scope.translationRequests = data;
    
            }, function (err) {
                $scope.success = false;
                $scope.error = err;
                $scope.busy = false;
            });
    
  • Simone Chiaretta 135 posts 542 karma points c-trib
    Mar 07, 2016 @ 21:18
    Simone Chiaretta
    0

    Basically, what I found out, is that the error handler doesn't get called in case the resource returns a 500 server error.

    But this way the clean-up code in my dialog never gets called. I think deferred.reject should always be called, in addition to showing the error.

    I created an issue http://issues.umbraco.org/issue/U4-8128 and a PR https://github.com/umbraco/Umbraco-CMS/pull/1157

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies