Error Handling Asynchronous Data

export default {
  async asyncData ({ params, error }) {
    try {
      const data = await get(`/api/${params.slug}`)
      return { title: data.title }
    } catch (e) {
      error({ statusCode: 404, message: 'Not found' })
    }
  }
}