From af54305bcaf19eab19e54a6b9c63f3a8b2de3ce4 Mon Sep 17 00:00:00 2001 From: Dominic Saadi Date: Tue, 19 Sep 2023 10:28:53 -0700 Subject: [PATCH] Revert "Update services.md (#9189)" This reverts commit ba9461c2afe7b35432bf57baa108357b913863c8. --- docs/docs/services.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/docs/services.md b/docs/docs/services.md index 2bc7feb98cd0..3301a7719d81 100644 --- a/docs/docs/services.md +++ b/docs/docs/services.md @@ -626,6 +626,12 @@ validateWithSync(() => { throw "You'll have to be more creative than that" } }) + +validateWithSync(() => { + if (input.name === 'Name') { + throw new Error("You'll have to be more creative than that") + } +}) ``` Either of these errors will be caught and re-thrown as a `ServiceValidationError` with your text as the `message` of the error (although technically you should always throw errors with `new Error()` like in the second example).