mirror of
https://github.com/ArthurDanjou/website-old.git
synced 2026-01-27 02:10:36 +01:00
Import Sentry
This commit is contained in:
@@ -119,7 +119,7 @@ export default defineComponent({
|
||||
name: "blog",
|
||||
head: {},
|
||||
setup() {
|
||||
const {$content, i18n, $axios, app, $storage} = useContext()
|
||||
const {$content, i18n, $axios, app, $storage, $sentry} = useContext()
|
||||
const route = useRoute()
|
||||
const { title } = useMeta()
|
||||
const slug = computed(() => route.value.params.slug)
|
||||
@@ -127,8 +127,9 @@ export default defineComponent({
|
||||
const post = useStatic((slug) => {
|
||||
return $content(`articles/${i18n.locale}`, slug)
|
||||
.fetch<Post>()
|
||||
.catch(() => {
|
||||
.catch((error) => {
|
||||
app.error({statusCode: 404, message: "Post not found"});
|
||||
$sentry.captureEvent(error)
|
||||
}) as Promise<Post>
|
||||
}, slug, 'post')
|
||||
|
||||
@@ -146,6 +147,8 @@ export default defineComponent({
|
||||
}
|
||||
}).then((response) => {
|
||||
likes.value = response.data
|
||||
}).catch((error) => {
|
||||
$sentry.captureEvent(error)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -160,6 +163,8 @@ export default defineComponent({
|
||||
liked.value = false
|
||||
likes.value = data.post.likes
|
||||
$storage.removeCookie(`${slug.value}`)
|
||||
} else {
|
||||
$sentry.captureEvent(data)
|
||||
}
|
||||
} else {
|
||||
const {data} = await $axios.post(`/posts/${post.value?.slug}/like`, {}, {
|
||||
@@ -173,6 +178,8 @@ export default defineComponent({
|
||||
$storage.setCookie(`${slug.value}`, true, {
|
||||
maxAge: 60 * 60 * 5
|
||||
})
|
||||
} else {
|
||||
$sentry.captureEvent(data)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,13 +41,16 @@ export default defineComponent({
|
||||
}
|
||||
},
|
||||
setup() {
|
||||
const { $content, i18n } = useContext()
|
||||
const { $content, i18n, $sentry } = useContext()
|
||||
|
||||
const posts = useAsync(() => {
|
||||
return $content(`articles/${i18n.locale}`)
|
||||
.sortBy('date', 'asc')
|
||||
.limit(10)
|
||||
.fetch<Post>()
|
||||
.catch((error) => {
|
||||
$sentry.captureEvent(error)
|
||||
})
|
||||
})
|
||||
|
||||
return {
|
||||
|
||||
@@ -37,9 +37,14 @@ export default {
|
||||
title: 'Contact - Arthur Danjou'
|
||||
},
|
||||
setup() {
|
||||
const {$content} = useContext()
|
||||
const {$content, $sentry} = useContext()
|
||||
const info = useAsync(() => {
|
||||
return $content('infos').fetch<InfoData>() as Promise<InfoData>
|
||||
return ($content('infos')
|
||||
.fetch<InfoData>()
|
||||
.catch((error) => {
|
||||
$sentry.captureEvent(error)
|
||||
})
|
||||
)as Promise<InfoData>
|
||||
})
|
||||
|
||||
const hiring_color = info && info.value?.hiring.color
|
||||
|
||||
@@ -31,10 +31,14 @@ export default {
|
||||
title: `Projects - Arthur Danjou`
|
||||
},
|
||||
setup() {
|
||||
const { $content, i18n } = useContext()
|
||||
const { $content, i18n, $sentry } = useContext()
|
||||
|
||||
const projects = useAsync(() => {
|
||||
return $content('projects').fetch<Project>()
|
||||
return $content('projects')
|
||||
.fetch<Project>()
|
||||
.catch((error) => {
|
||||
$sentry.captureEvent(error)
|
||||
})
|
||||
})
|
||||
|
||||
useMeta( {
|
||||
|
||||
Reference in New Issue
Block a user