chore: generate
This commit is contained in:
parent
ebe6087e8f
commit
a9ccb0804f
3 changed files with 20 additions and 11 deletions
|
|
@ -36,9 +36,7 @@ export const errorLayer = HttpRouter.middleware<{ handles: unknown }>()((effect)
|
||||||
}),
|
}),
|
||||||
Effect.map(normalizeEmptyBadRequest),
|
Effect.map(normalizeEmptyBadRequest),
|
||||||
Effect.catchCause((cause) => {
|
Effect.catchCause((cause) => {
|
||||||
const schemaError = cause.reasons
|
const schemaError = cause.reasons.filter(Cause.isDieReason).find((reason) => HttpApiSchemaError.is(reason.defect))
|
||||||
.filter(Cause.isDieReason)
|
|
||||||
.find((reason) => HttpApiSchemaError.is(reason.defect))
|
|
||||||
if (schemaError) return Effect.succeed(badRequestResponse())
|
if (schemaError) return Effect.succeed(badRequestResponse())
|
||||||
|
|
||||||
const defect = cause.reasons.filter(Cause.isDieReason).find((reason) => {
|
const defect = cause.reasons.filter(Cause.isDieReason).find((reason) => {
|
||||||
|
|
@ -63,7 +61,7 @@ export const errorLayer = HttpRouter.middleware<{ handles: unknown }>()((effect)
|
||||||
return 500
|
return 500
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if (error instanceof Session.BusyError) {
|
if (error instanceof Session.BusyError) {
|
||||||
return Effect.succeed(
|
return Effect.succeed(
|
||||||
|
|
|
||||||
|
|
@ -137,8 +137,14 @@ describe("instance HttpApi", () => {
|
||||||
)
|
)
|
||||||
const [permission, questionReply, questionReject] = yield* Effect.all(
|
const [permission, questionReply, questionReject] = yield* Effect.all(
|
||||||
[
|
[
|
||||||
request("/permission/invalid-permission-id/reply", { method: "POST", body: JSON.stringify({ reply: "once" }) }),
|
request("/permission/invalid-permission-id/reply", {
|
||||||
request("/question/invalid-question-id/reply", { method: "POST", body: JSON.stringify({ answers: [["Yes"]] }) }),
|
method: "POST",
|
||||||
|
body: JSON.stringify({ reply: "once" }),
|
||||||
|
}),
|
||||||
|
request("/question/invalid-question-id/reply", {
|
||||||
|
method: "POST",
|
||||||
|
body: JSON.stringify({ answers: [["Yes"]] }),
|
||||||
|
}),
|
||||||
request("/question/invalid-question-id/reject", { method: "POST" }),
|
request("/question/invalid-question-id/reject", { method: "POST" }),
|
||||||
],
|
],
|
||||||
{ concurrency: "unbounded" },
|
{ concurrency: "unbounded" },
|
||||||
|
|
|
||||||
|
|
@ -9057,7 +9057,8 @@
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"id": {
|
"id": {
|
||||||
"type": "string"
|
"type": "string",
|
||||||
|
"pattern": "^per"
|
||||||
},
|
},
|
||||||
"sessionID": {
|
"sessionID": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
|
@ -9355,7 +9356,8 @@
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"id": {
|
"id": {
|
||||||
"type": "string"
|
"type": "string",
|
||||||
|
"pattern": "^que"
|
||||||
},
|
},
|
||||||
"sessionID": {
|
"sessionID": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
|
@ -9387,7 +9389,8 @@
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"requestID": {
|
"requestID": {
|
||||||
"type": "string"
|
"type": "string",
|
||||||
|
"pattern": "^que"
|
||||||
},
|
},
|
||||||
"answers": {
|
"answers": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
|
|
@ -9406,7 +9409,8 @@
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"requestID": {
|
"requestID": {
|
||||||
"type": "string"
|
"type": "string",
|
||||||
|
"pattern": "^que"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": ["sessionID", "requestID"],
|
"required": ["sessionID", "requestID"],
|
||||||
|
|
@ -15815,7 +15819,8 @@
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"requestID": {
|
"requestID": {
|
||||||
"type": "string"
|
"type": "string",
|
||||||
|
"pattern": "^per"
|
||||||
},
|
},
|
||||||
"reply": {
|
"reply": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue