JsonMergePatch.Error exception (JsonMergePatch v0.1.0)

Copy Markdown View Source

Exception returned or raised by JsonMergePatch.

JsonMergePatch.apply_patch/2 returns {:error, exception} and JsonMergePatch.apply_patch!/2 raises. A call reports one error: the target is checked first, then the patch. If both are invalid, reason is :invalid_target.

  • :invalid_target - the target is not a JSON value
  • :invalid_patch - the patch is not a JSON value
  • :max_depth_exceeded - the patch nesting is over :max_depth

Summary

Types

reason()

@type reason() :: :invalid_target | :invalid_patch | :max_depth_exceeded

t()

@type t() :: %JsonMergePatch.Error{__exception__: true, reason: reason()}