@rest-vir/run-service 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -31,6 +31,10 @@ export async function handleEndpointRequest({ endpoint, request, response, attac
|
|
|
31
31
|
server,
|
|
32
32
|
};
|
|
33
33
|
const endpointResult = (await endpoint.implementation(endpointParams));
|
|
34
|
+
/** If the dev forgets to set a status code. */
|
|
35
|
+
if (!endpointResult.statusCode) {
|
|
36
|
+
throw new RestVirHandlerError(endpoint, 'Missing response status code.');
|
|
37
|
+
}
|
|
34
38
|
if (isErrorHttpStatus(endpointResult.statusCode)) {
|
|
35
39
|
endpoint.service.logger.error(new RestVirHandlerError(endpoint, `Endpoint implementation returned error status: ${endpointResult.statusCode}`));
|
|
36
40
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rest-vir/run-service",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "Run a service defined by @rest-vir/define-service and implemented by @rest-vir/implement-service.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"rest",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"@augment-vir/common": "^31.11.0",
|
|
44
44
|
"@augment-vir/node": "^31.11.0",
|
|
45
45
|
"@fastify/websocket": "^11.0.2",
|
|
46
|
-
"@rest-vir/define-service": "^0.
|
|
47
|
-
"@rest-vir/implement-service": "^0.
|
|
46
|
+
"@rest-vir/define-service": "^0.13.0",
|
|
47
|
+
"@rest-vir/implement-service": "^0.13.0",
|
|
48
48
|
"cluster-vir": "^0.1.0",
|
|
49
49
|
"date-vir": "^7.3.1",
|
|
50
50
|
"fastify": "^5.3.0",
|