Skip to content

error when processing errors #118

Description

@Lobosque

When processing errors, the library assumes that the meta object is present:

    ValidationErrorBuilder.prototype.apply = function () {
        var _this = this;
        var errorsAccumulator = {};
        if (!this.payload.errors) {
            return;
        }
        this.payload.errors.forEach(function (err) {
            var meta = err.meta;
            var metaRelationship = meta.relationship;
            if (metaRelationship) {
                _this._processRelationship(_this.model, metaRelationship, err);
            }
            else {
                _this._processResource(errorsAccumulator, meta, err);
            }
        });
        this.model.errors = errorsAccumulator;
    };

However, per specification, meta (or any other field in errors array for that matter) is not a mandatory field.

What exactly is metaRelationship that it expects to find inside meta?
Is jsorm supposed to work only with an specific server implementation of jsonapi?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions