From 5616b3cc1f1f25e089f9a35cfe1ebdd2d9ea5e94 Mon Sep 17 00:00:00 2001 From: garrettmills Date: Tue, 5 Apr 2022 14:02:16 -0500 Subject: [PATCH] Add suggestion for missing schema for validator error --- package.json | 2 +- src/http/response/ErrorResponseFactory.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 2f358b0..73a4578 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@extollo/lib", - "version": "0.9.31", + "version": "0.9.32", "description": "The framework library that lifts up your code.", "main": "lib/index.js", "types": "lib/index.d.ts", diff --git a/src/http/response/ErrorResponseFactory.ts b/src/http/response/ErrorResponseFactory.ts index 400a680..ce24283 100644 --- a/src/http/response/ErrorResponseFactory.ts +++ b/src/http/response/ErrorResponseFactory.ts @@ -107,6 +107,8 @@ ${Object.keys(context).map(key => ` - ${key} : ${JSON.stringify(context[key]) protected getSuggestion(): string { if ( this.thrownError.message.startsWith('No such dependency is registered with this container: class SecurityContext') ) { return 'It looks like this route relies on the security framework. Is the route you are accessing inside a middleware (e.g. SessionAuthMiddleware)?' + } else if ( this.thrownError.message.startsWith('Unable to resolve schema for validator') ) { + return 'Make sure the directory in which the interface file is located is listed in extollo.cc.zodify in package.json, and that it ends with the proper .type.ts suffix.' } return ''