Skip to content
Snippets Groups Projects
Commit 5ef97a84 authored by florian's avatar florian
Browse files

ENH: Add Exception type for client exceptions

parent 45dabd84
No related branches found
No related tags found
1 merge request!7ENH: Implement queries and entity retrieval
......@@ -56,6 +56,22 @@ struct GenericCaosDBException <: CaosDBException
code::Cint
end
"""
Something went wrong on the client-side or the user is attempting to
conduct an invalid operation.
"""
struct ClientException <: CaosDBException
msg::String
code::Cint
function ClientException(message::AbstractString)
client_error_code =
ccall((:caosdb_status_code_OTHER_CLIENT_ERROR, CaosDB.library_name), Cint, ())
new(message, client_error_code)
end
end
Base.showerror(io::IO, e::CaosDBException) =
print(io, "CaosDBException: ", e.msg, " (Status code ", e.code, ")")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment