Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Lifeware
biocham
Commits
80cc71c4
Commit
80cc71c4
authored
Oct 17, 2015
by
SOLIMAN Sylvain
Browse files
use print_message for our own exceptions too
parent
b74cc441
Changes
1
Hide whitespace changes
Inline
Side-by-side
toplevel.pl
View file @
80cc71c4
...
...
@@ -58,27 +58,18 @@ execute_command(Command) :-
throw
(
error
(
prolog_failure
))
),
Exception
,
print_
exception
(
Exception
)
print_
message
(
error
,
Exception
)
).
print_exception
(
Exception
)
:-
(
Exception
=
error
(
Error
),
error_message
(
Error
,
Message
)
->
format
(
'~w\n'
,
Message
)
;
format
(
'Uncaught exception: ~p\n'
,
Exception
)
).
error_message
(
unknown_command
(
Command
),
Message
)
:-
format
(
atom
(
Message
),
'Unknown command: ~p'
,
[
Command
]).
prolog
:
message
(
error
(
unknown_command
(
Command
)))
-->
[
'Unknown command: ~p'
-
[
Command
]].
prolog
:
message
(
error
(
prolog_failure
))
-->
[
'Prolog failure'
].
error_
message
(
prolog_failure
,
Message
)
:-
format
(
atom
(
Message
),
'Prolog failure'
,
[])
.
prolog
:
message
(
error
(
Exception
))
-->
[
'Uncaught exception: ~p'
-
[
Exception
]]
.
check_types
(
Command
,
ArgumentTypes
,
NewCommand
)
:-
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment