mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-12 12:04:16 +00:00
use try catch
This commit is contained in:
parent
0af07301f4
commit
974733bc5f
@ -5,6 +5,7 @@ import isNSFW from "../../../utils/is-nsfw"
|
|||||||
import modifyPostData from "./modifyPostData"
|
import modifyPostData from "./modifyPostData"
|
||||||
|
|
||||||
export default async (post_id) => {
|
export default async (post_id) => {
|
||||||
|
try {
|
||||||
if (!post_id) {
|
if (!post_id) {
|
||||||
throw new Error("Post ID is required")
|
throw new Error("Post ID is required")
|
||||||
}
|
}
|
||||||
@ -45,4 +46,9 @@ export default async (post_id) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return flags
|
return flags
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error)
|
||||||
|
|
||||||
|
return []
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user