public static <T> T context(
            String message,
            FromSourceLocation sourceLocation,
            Evaluator<T> runnable
    ) throws RuleError {
        try {
            return runnable.call();
        } catch (SourceException ex) {
            throw new RuleError(ex).withContext(message, sourceLocation.getSourceLocation());
        } catch (RuleError ex) {
            throw ex.withContext(message, sourceLocation.getSourceLocation());
        } catch (Exception | Error ex) {
            if (ex.getMessage() == null) {
                throw new RuntimeException(ex);
            }
            throw new RuleError(new SourceException(ex.getMessage(), sourceLocation.getSourceLocation(), ex))
                    .withContext(message, sourceLocation.getSourceLocation());
        }
    }
Evaluates the runnable and creates a RuleError with the provided context if there's an error.

@param <T> the type of the value returned by the runnable.
@param message a message representing the context for this runnable statement's evaluation.
@param sourceLocation the source location for this runnable statement's evaluation.
@param runnable a runnable to evaluate a statement in the current context.
@return the value returned by the runnable.
@throws RuleError when the rule being evaluated in the context fails.
smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/language/error/RuleError.java