Skip to content
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

Make gap error handler throw an error #144

Merged
merged 2 commits into from
Nov 8, 2018
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions LibGAP.jl/src/initialization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ read_sysinfo_gap = function(dir::String)
return d
end

function error_handler(message)
print(message)
function error_handler()
error("Error thrown by GAP")
Copy link
Member

Choose a reason for hiding this comment

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

Could this perhaps include the message?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will check how to achieve this. It seemed to me that the message gets printed by GAP anyway.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, I see: I thought this is just a mater of printing message. But now looking at how the "error callback" is called, I realized that it actually gets no arguments -- and this signature here is incorrect.

end

error_handler_func = @cfunction(error_handler,Cvoid,(Ptr{Char},))
error_handler_func = @cfunction(error_handler,Cvoid,())

const pkgdir = realpath(dirname(@__FILE__))

Expand Down
3 changes: 3 additions & 0 deletions LibGAP.jl/test/basics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@
@test GAP.True
@test ! GAP.False


xx = GAP.to_gap([1,2,3])
@test_throws ErrorException xx[4]
end