Skip to content

Update error message to match on OTP 24 #47

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

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion test/ecto/adapters/sqlite3/connection_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2370,9 +2370,20 @@ defmodule Ecto.Adapters.SQLite3.ConnectionTest do
end

test "create table with an unsupported type" do
msg =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually think it is fine to just return the multi string error message regardless of OTP version.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message afaik is not in our control. The difference is due to improvments on error messages for NIFs and BIFs, which are part of OTP24.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see. I don't think inside the NIF we raise any exceptions there, just return atom error tuples. 👍🏻

if :erlang.system_info(:otp_release) >= '24' do
"""
errors were found at the given arguments:

* 1st argument: not an atom
"""
else
"argument error"
end

assert_raise(
ArgumentError,
"argument error",
msg,
fn ->
{:create, table(:posts),
[
Expand Down