Skip to content

update deprecated code to make it work with elixir 0.13 #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

michelson
Copy link

Hi , this pull request is made in order to make this library compile with elixir 0.13

regards

@mweibel
Copy link

mweibel commented Jun 24, 2014

👍

In order to make it compile on elixir 0.14.1, I updated the exceptions.ex file as follows:

diff --git a/lib/data/exceptions.ex b/lib/data/exceptions.ex
index 23521f1..c70816a 100644
--- a/lib/data/exceptions.ex
+++ b/lib/data/exceptions.ex
@@ -6,15 +6,21 @@
 #
 #  0. You just DO WHAT THE FUCK YOU WANT TO.

-defexception Data.Empty, message: "the data is empty"
-defexception Data.OutOfBounds, message: "out of bounds"
+defmodule Data.Empty do
+  defexception message: "the data is empty"
+end
+defmodule Data.OutOfBounds do
+  defexception message: "out of bounds"
+end
+
+defmodule Data.Missing do
+  defexception message: nil

-defexception Data.Missing, key: nil, what: nil do
-  def message( key ) when key != nil do
+  def exception(key: key) when key != nil do
     "key missing: #{inspect key}"
   end

-  def message( what ) when what != nil do
+  def exception(what: what) when what != nil do
     "#{inspect what} is missing"
   end
 end

I didn't test that out yet however, might be wrong ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants