elixir-sqlite / exqlite

An SQLite3 driver for Elixir
https://hexdocs.pm/exqlite
MIT License
198 stars 46 forks source link

Cast all error reasons to String #242

Closed liamdiprose closed 1 year ago

liamdiprose commented 1 year ago

I get this error every so often:

21:28:43.249 [error] Exqlite.Connection (#PID<0.2627.0>) failed to connect: 
** (Exqlite.Error) got :database_open_failed while retrieving Exception.message/1 
for %Exqlite.Error{message: :database_open_failed, statement: nil} (expected a string)

The NIF returns error reason's as atoms, but Exqlite.Error expects a String. This PR fixes this issue by wrapping all reason's with to_string/1.

Please don't hesitate to take a different approach if you feel another one is more appropriate :heart:

warmwaffles commented 1 year ago

Released under v0.13.6