From 37eb0949b75544d903398f66fda79dcf19332c92 Mon Sep 17 00:00:00 2001 From: "Sebastien Rosset (serosset)" Date: Sun, 19 Mar 2023 09:12:47 -0700 Subject: [PATCH] Add section for error handling --- docs/specification.rst | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/specification.rst b/docs/specification.rst index 8dc8da9..9f9dc1f 100644 --- a/docs/specification.rst +++ b/docs/specification.rst @@ -227,6 +227,27 @@ Examples search("\u2713", {"\u2713": "value"}) -> "value" +.. _errors: + +Errors +====== + +Errors may be raised during the JMEspath evaluation process. How and when errors +are raised is implementation specific, but implementations should indicate to +the caller when errors have occurred. + +The following errors are defined: + +* ``invalid-type`` is raised when an invalid type is encountered during the + evaluation process. +* ``invalid-value`` is raised when an invalid value is encountered during the + evaluation process. +* ``unknown-function`` is raised when an unknown function is encountered during + the evaluation process. +* ``invalid-arity`` is raised when an invalid number of function arguments is + encountered during the evaluation process. + + .. _subexpressions: SubExpressions