diff --git a/CHANGELOG.md b/CHANGELOG.md index b5e3daa..24442b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # CHANGELOG +## 3.0.3 (05.09.2024) +- Remove check for empty result + ## 3.0.2 (22.08.2024) - Disable Application Insights internal debug logging diff --git a/package-lock.json b/package-lock.json index b950011..ab0e53b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@senacor/azure-function-middleware", - "version": "3.0.2", + "version": "3.0.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@senacor/azure-function-middleware", - "version": "3.0.2", + "version": "3.0.3", "license": "MIT", "dependencies": { "@azure/functions": "^4.0.0", diff --git a/package.json b/package.json index 78e8edc..6282fa5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@senacor/azure-function-middleware", - "version": "3.0.2", + "version": "3.0.3", "description": "Middleware for azure functions to handle authentication, authorization, error handling and logging", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/middleware.ts b/src/middleware.ts index 6c8dd29..a2c79db 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -21,7 +21,7 @@ const middlewareCore = handler: T, postExecution: (PostExecutionFunction | false)[], ) => - async (request: Parameters, context: InvocationContext): Promise | Error> => { + async (request: Parameters, context: InvocationContext): Promise | undefined | Error> => { let handlerResult: MiddlewareResult> = { $failed: false, $result: undefined }; if (beforeExecution) { @@ -65,10 +65,6 @@ const middlewareCore = return handlerResult.$error; } - if (handlerResult.$result === undefined) { - return new Error('Illegal-State: Result of the handler was empty.'); - } - return handlerResult.$result; };