Skip to content

Handling spring data rest exception #19

@sydneyhenrard

Description

@sydneyhenrard

My spring data rest implementation throws exception in some cases. I would like to handle that exception in the error part of the promise call. The issue is that the error part is not called.

var myHttpPromise = $http.post('http://localhost:54000/api/v1/systems', vm.data);
SpringDataRestAdapter.process(myHttpPromise)
    .then(function (processedResponse) {
    }, function(response) {
            console.log(response);
    });

I looked at the code in angular-spring-data-rest-interceptor-provider.js and I was wondering if you should reject the promise in case of erros.

return SpringDataRestAdapter.process(response.data).then(function (processedResponse) {
                                response.data = processedResponse;
                                return response;
, function(response) {
            return $q.reject(response);
    });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions