mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Logging malformed request on error
This commit is contained in:
parent
136fa0d759
commit
a8ac2dd877
2 changed files with 8 additions and 2 deletions
|
@ -188,7 +188,13 @@ app.get('/ask', function (req, res) {
|
||||||
} else {
|
} else {
|
||||||
if (req.query.q && req.query.data) {
|
if (req.query.q && req.query.data) {
|
||||||
let subj = req.query.subj || ''
|
let subj = req.query.subj || ''
|
||||||
let question = decodeURIComponent(req.query.q)
|
let question
|
||||||
|
try {
|
||||||
|
question = decodeURIComponent(req.query.q)
|
||||||
|
} catch (e) {
|
||||||
|
console.error(req.query)
|
||||||
|
throw e
|
||||||
|
}
|
||||||
let recData = {}
|
let recData = {}
|
||||||
try {
|
try {
|
||||||
recData = JSON.parse(req.query.data)
|
recData = JSON.parse(req.query.data)
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit f5f97bcac6ce43cfe2faa4744b012596bd80f791
|
Subproject commit 95a3067d623043ee34d4092f053d7ec7bdb93fa3
|
Loading…
Add table
Add a link
Reference in a new issue