Skip to content

Commit

Permalink
saving changes
Browse files Browse the repository at this point in the history
  • Loading branch information
yordis committed Jan 2, 2023
1 parent b793968 commit 1dae56a
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 10 deletions.
18 changes: 18 additions & 0 deletions apps/one_piece_error/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,21 @@ A package to deal with Errors and Exceptions.
### References

- [API Reference](api-reference.html)



## Notes

- message
- code
- tracing id
- vault error code


{
"error_type": "BANK_TRANSFER_ERROR",
"error_code": "BANK_TRANSFER_LIMIT_EXCEEDED",
"error_message": "bank transfer daily transfer limit exceeded",
"display_message": null,
"request_id": "HNTDNrA8F1shFEW"
}
10 changes: 0 additions & 10 deletions apps/one_piece_error/lib/one_piece/clock.ex

This file was deleted.

17 changes: 17 additions & 0 deletions apps/one_piece_error/lib/one_piece/error.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
defmodule OnePiece.Error do
def __using__ do
quote generated: true do
defexception message: "runtime error"

defexception [:struct, :term]

@impl true
def message(exception) do
"expected a struct named #{inspect(exception.struct)}, got: #{inspect(exception.term)}"
end
end
end

# TODO: add `blame` callback
# https://hexdocs.pm/elixir/Exception.html
end

0 comments on commit 1dae56a

Please sign in to comment.