Repl.ErrorsThis module defines a set of error-handling functions for the REPL (Read-Eval-Print Loop) of the interpreter. These functions return results that encapsulate potential errors in a structured way, allowing for detailed error reporting and handling.
val invalid_command :
?errors:Ast.Error.detailed_error list ->
?nearest:string ->
?distance:int ->
string list ->
('a, Ast.Error.detailed_error list) Stdlib.resultinvalid_command ?errors ?nearest ?distance commands returns an error result indicating that the given command is invalid. Optionally, it can include a list of detailed errors, the nearest valid command, and the distance (e.g., Levenshtein distance) to the nearest valid command.
val file_not_exists :
?errors:Ast.Error.detailed_error list ->
string ->
('a, Ast.Error.detailed_error list) Stdlib.resultfile_not_exists ?errors filepath returns an error result indicating that the specified file does not exist.
val invalid_file_extension :
?errors:Ast.Error.detailed_error list ->
supported:string ->
?got:string ->
unit ->
('a, Ast.Error.detailed_error list) Stdlib.resultinvalid_file_extension ?errors ~supported ?got () returns an error result indicating that the file has an invalid extension. It specifies the supported extensions and optionally the extension that was provided.
val invalid_export_mode :
?errors:Ast.Error.detailed_error list ->
string ->
('a, Ast.Error.detailed_error list) Stdlib.resultinvalid_export_mode ?errors mode returns an error result indicating that the specified export mode is invalid.
val invalid_view_mode :
?errors:Ast.Error.detailed_error list ->
string ->
('a, Ast.Error.detailed_error list) Stdlib.resultinvalid_view_mode ?errors mode returns an error result indicating that the specified view mode is invalid.
val invalid_view_combination :
?errors:Ast.Error.detailed_error list ->
?hint:string ->
string ->
string ->
('a, Ast.Error.detailed_error list) Stdlib.resultinvalid_view_combination ?errors ?hint view1 view2 returns an error result indicating that the combination of the two specified view modes is invalid. Optionally, it can include a hint for resolving the issue.
val invalid_number_rollback :
?errors:Ast.Error.detailed_error list ->
int ->
('a, Ast.Error.detailed_error list) Stdlib.resultinvalid_number_rollback ?errors n returns an error result indicating that the specified number of rollbacks is invalid.