mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Send status 500 instead of not-responsiveness
This commit is contained in:
parent
f73198f9f2
commit
17fdbf4389
@ -12,7 +12,9 @@ router.get('/', async function (req, res) {
|
||||
const nameAndDomain = resource.replace('acct:', '')
|
||||
const name = nameAndDomain.split('@')[0]
|
||||
|
||||
const result = await req.app.get('ap').dataSource.client.query({
|
||||
let result
|
||||
try {
|
||||
result = await req.app.get('ap').dataSource.client.query({
|
||||
query: gql`
|
||||
query {
|
||||
User(slug: "${name}") {
|
||||
@ -21,6 +23,9 @@ router.get('/', async function (req, res) {
|
||||
}
|
||||
`
|
||||
})
|
||||
} catch (error) {
|
||||
return res.status(500).json({ error })
|
||||
}
|
||||
|
||||
if (result.data && result.data.User.length > 0) {
|
||||
const webFinger = createWebFinger(name)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user