Import Sentry

This commit is contained in:
2021-04-27 21:47:26 +02:00
parent 6e45298506
commit c202252f3b
16 changed files with 334 additions and 31 deletions

View File

@@ -26,9 +26,13 @@ import {InfoData} from "../../@types/types";
export default defineComponent({
name: "AboutPreview",
setup() {
const {$content} = useContext()
const {$content, $sentry} = useContext()
const info = useAsync(() => {
return $content('infos').fetch<InfoData>()
return $content('infos')
.fetch<InfoData>()
.catch((error) => {
$sentry.captureEvent(error)
})
})
return {

View File

@@ -76,7 +76,7 @@ export default defineComponent({
const error = ref(false)
const success = ref(false)
const {$axios} = useContext()
const {$axios, $sentry} = useContext()
const form = ref<Form>({} as Form)
const handleForm = async () => {
const {data} = await $axios.post('form',
@@ -97,6 +97,7 @@ export default defineComponent({
form.value = {} as Form
}, 5000)
} else {
$sentry.captureEvent(data)
error.value = true
setTimeout(() => {
error.value = false

View File

@@ -24,12 +24,15 @@ import {Experience} from "../../@types/types";
export default defineComponent({
name: "ExperiencesAbout",
setup() {
const {$content} = useContext()
const {$content, $sentry} = useContext()
const experiences = useAsync(() => {
return $content('experiences')
.sortBy('end_date', 'desc')
.fetch<Experience>()
.catch((error) => {
$sentry.captureEvent(error)
})
})
return {

View File

@@ -24,12 +24,15 @@ import {Formation} from "../../@types/types";
export default defineComponent({
name: "FormationsHome",
setup() {
const {$content} = useContext()
const {$content, $sentry} = useContext()
const formations = useAsync(() => {
return $content('formations')
.sortBy('end_date', 'desc')
.fetch<Formation>()
.catch((error) => {
$sentry.captureEvent(error)
})
})
return {

View File

@@ -36,13 +36,16 @@ import {Post} from "../../@types/types";
export default defineComponent({
name: "PostsHome",
setup() {
const { $content, i18n } = useContext()
const { $content, i18n, $sentry } = useContext()
const posts = useAsync(() => {
return $content(`articles/${i18n.locale}`)
.sortBy('date', 'asc')
.limit(3)
.fetch<Post>()
.catch((error) => {
$sentry.captureEvent(error)
})
}, 'posts')
return {

View File

@@ -34,12 +34,15 @@ import {Project} from "../../@types/types";
export default defineComponent({
name: "ProjectsHome",
setup() {
const { $content } = useContext()
const { $content, $sentry } = useContext()
const projects = useAsync(() => {
return $content(`projects`)
.limit(3)
.fetch<Project>()
.catch((error) => {
$sentry.captureEvent(error)
})
}, 'projects')
return {

View File

@@ -25,10 +25,14 @@ import {Skill} from "../../@types/types";
export default defineComponent({
name: "SkillsAbout",
setup() {
const {$content} = useContext()
const {$content, $sentry} = useContext()
const skills = useAsync(() => {
return $content('skills').fetch<Skill>()
return $content('skills')
.fetch<Skill>()
.catch((error) => {
$sentry.captureEvent(error)
})
})
return {