-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Solver] WIP: simplify context and internal error handling
- Loading branch information
Showing
8 changed files
with
83 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
(* Representation of internal exceptions used by solver. | ||
* | ||
* Author: Tomas Dacik (idacik00@fit.vut.cz), 2025 *) | ||
|
||
exception UnknownResult of string * string | ||
|
||
exception UnsupportedFragment of string * string | ||
|
||
exception CmdOptionError of string | ||
|
||
exception InternalError of string * string | ||
|
||
let unsupported_fragment ~reason ?(details="") = | ||
raise @@ UnsupportedFragment (reason, details) | ||
|
||
let unknown_result ~reason ?(details="") = | ||
raise @@ UnknownResult (reason, details) | ||
|
||
let internal_error ~reason ?(details="") = | ||
raise @@ InternalError (reason, details) | ||
|
||
|
||
(** Pretty printers *) | ||
let pretty_internal_error reason details = | ||
Format.eprintf "%s[Internal error]%s %s\n" Colors.red Colors.white reason; | ||
(*if backtrace then begin | ||
Format.eprintf "\nBacktrace:\n%s" | ||
(Printexc.raw_backtrace_to_string stack) | ||
end;*) | ||
if true then Format.fprintf Format.err_formatter "\n%s\n" details |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
(* Representation of solver's internal error. | ||
* | ||
* Author: Tomas Dacik (idacik00@fit.vut.cz), 2025 *) | ||
|
||
exception UnsupportedFragment of string * string | ||
(** This exception is raised when unsupported fragment is detected. *) | ||
|
||
exception UnknownResult of string * string | ||
|
||
exception InternalError of string * string | ||
(** This exception represents an internal error. It should not | ||
be catched inside Astral library. *) | ||
|
||
exception CmdOptionError of string | ||
|
||
val unknown_result : reason:string -> ?details:string -> _ | ||
|
||
val unsupported_fragment : reason:string -> ?details:string -> _ | ||
|
||
val internal_error : reason:string -> ?details:string -> _ | ||
|
||
val pretty_internal_error : string -> string -> unit |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters