mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-11 03:24: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"
|
||||
|
||||
export default async (post_id) => {
|
||||
try {
|
||||
if (!post_id) {
|
||||
throw new Error("Post ID is required")
|
||||
}
|
||||
@ -45,4 +46,9 @@ export default async (post_id) => {
|
||||
}
|
||||
|
||||
return flags
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
|
||||
return []
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user