[PPL-devel] [GIT] ppl/ppl(master): Revised exceptions that can be thrown.
Patricia Hill
p.m.hill at leeds.ac.uk
Mon Mar 22 13:06:13 CET 2010
Module: ppl/ppl
Branch: master
Commit: 3ac27881f203b6c0c085747486dd38ee8c556acf
URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=3ac27881f203b6c0c085747486dd38ee8c556acf
Author: Patricia Hill <p.m.hill at leeds.ac.uk>
Date: Mon Mar 22 12:01:52 2010 +0000
Revised exceptions that can be thrown.
---
interfaces/OCaml/ppl_ocaml_common.defs.hh | 8 ++++++++
interfaces/Prolog/ppl_prolog_common.cc | 10 ----------
interfaces/Prolog/ppl_prolog_common.defs.hh | 6 ------
3 files changed, 8 insertions(+), 16 deletions(-)
diff --git a/interfaces/OCaml/ppl_ocaml_common.defs.hh b/interfaces/OCaml/ppl_ocaml_common.defs.hh
index 7754c68..21e64f9 100644
--- a/interfaces/OCaml/ppl_ocaml_common.defs.hh
+++ b/interfaces/OCaml/ppl_ocaml_common.defs.hh
@@ -201,6 +201,14 @@ catch(std::overflow_error& e) { \
caml_raise_with_string(*caml_named_value("PPL_arithmetic_overflow"), \
(const_cast<char*>(e.what()))); \
} \
+catch(std::domain_error& e) { \
+ caml_raise_with_string(*caml_named_value("PPL_domain_error"), \
+ (const_cast<char*>(e.what()))); \
+} \
+catch(std::length_error& e) { \
+ caml_raise_with_string(*caml_named_value("PPL_length_error"), \
+ (const_cast<char*>(e.what()))); \
+} \
catch(std::logic_error& e) { \
caml_raise_with_string(*caml_named_value("PPL_logic_error"), \
(const_cast<char*>(e.what()))); \
diff --git a/interfaces/Prolog/ppl_prolog_common.cc b/interfaces/Prolog/ppl_prolog_common.cc
index 1632a3d..2373e3d 100644
--- a/interfaces/Prolog/ppl_prolog_common.cc
+++ b/interfaces/Prolog/ppl_prolog_common.cc
@@ -161,7 +161,6 @@ Prolog_atom a_ppl_overflow_error;
Prolog_atom a_ppl_domain_error;
Prolog_atom a_ppl_length_error;
Prolog_atom a_ppl_invalid_argument;
-Prolog_atom a_ppl_out_of_range;
Prolog_atom a_ppl_logic_error;
Prolog_atom a_ppl_representation_error;
Prolog_atom a_expected;
@@ -248,7 +247,6 @@ const Prolog_Interface_Atom prolog_interface_atoms[] = {
{ &a_ppl_domain_error, "ppl_domain_error" },
{ &a_ppl_length_error, "ppl_length_error" },
{ &a_ppl_invalid_argument, "ppl_invalid_argument" },
- { &a_ppl_out_of_range, "ppl_out_of_range" },
{ &a_ppl_logic_error, "ppl_logic_error" },
{ &a_ppl_representation_error, "ppl_representation_error" },
{ &a_expected, "expected" },
@@ -604,14 +602,6 @@ handle_exception(const std::invalid_argument& e) {
}
void
-handle_exception(const std::out_of_range& e) {
- Prolog_term_ref et = Prolog_new_term_ref();
- Prolog_construct_compound(et, a_ppl_out_of_range,
- Prolog_atom_term_from_string(e.what()));
- Prolog_raise_exception(et);
-}
-
-void
handle_exception(const std::logic_error& e) {
Prolog_term_ref et = Prolog_new_term_ref();
Prolog_construct_compound(et, a_ppl_logic_error,
diff --git a/interfaces/Prolog/ppl_prolog_common.defs.hh b/interfaces/Prolog/ppl_prolog_common.defs.hh
index 2de53de..6fb21c6 100644
--- a/interfaces/Prolog/ppl_prolog_common.defs.hh
+++ b/interfaces/Prolog/ppl_prolog_common.defs.hh
@@ -419,9 +419,6 @@ void
handle_exception(const std::invalid_argument& e);
void
-handle_exception(const std::out_of_range& e);
-
-void
handle_exception(const std::logic_error& e);
void
@@ -525,9 +522,6 @@ handle_exception(const deterministic_timeout_exception&);
catch(const std::invalid_argument& e) { \
handle_exception(e); \
} \
- catch(const std::out_of_range& e) { \
- handle_exception(e); \
- } \
catch (const std::logic_error& e) { \
handle_exception(e); \
} \
More information about the PPL-devel
mailing list