TrestleAdmin/trestle

View on GitHub
frontend/js/core/turbo_errors.js

Summary

Maintainability
A
0 mins
Test Coverage
import ErrorModal from './error_modal'

document.addEventListener('turbo:frame-missing', async (e) => {
  e.preventDefault()

  const response = e.detail.response
  const title = `${response.status} (${response.statusText})`
  response.text().then(content => ErrorModal.show({ title, content }))
})