Runable v1.0.0-alpha.20
Why Runable? Docs Modules Work with AI Blog About Changelog
  • 01Why Runable?
  • 02Docs
  • 03Modules
  • 04Work with AI
  • 05Blog
  • 06About
  • 07Changelog
Vue without a fixed server runtime.
Getting Started Structure Integrations Guide MCP API
  • Getting Started Structure Integrations Guide MCP API
Build the Interface
  • Routing
  • Layouts
  • Middlewares
  • Error Handling
Load and Render
  • Data Fetching
  • SSR and CSR
  • Head and SEO
Extend Runable
  • Auto-imports
  • Plugins
  • Modules
Configure and Ship
  • Runtime Configuration
  • CSS and Assets
  • Production Build
CLI
  • Overview
  • Create
  • Prepare
  • Build
  • MCP
  • AI Skills
  • Inspector

Error handling

Capture Vue, Router, and browser errors in a consistent interface.

Runable installs error state isolated to each Vue application. It captures Vue rendering errors, Vue Router errors, global browser errors, and unhandled promise rejections.

Display an error manually

<script setup lang="ts">
const { showError } = useAppError();

async function save() {
  try {
    await saveProject();
  } catch (error) {
    showError(error, {
      code: "PROJECT_SAVE_FAILED",
      statusCode: 500,
      info: "Unable to save the project",
    });
  }
}
</script>

When the state contains an error, RunableApp replaces the current interface with the error screen.

Customize the screen

Create app/error.vue:

<script setup lang="ts">
defineProps<{ error: { code: string; message: string } }>();
defineEmits<{ clear: [] }>();
</script>

<template>
  <main>
    <p>{{ error.code }}</p>
    <h1>{{ error.message }}</h1>
    <button type="button" @click="$emit('clear')">Try again</button>
  </main>
</template>

The clear event resets the error and restores the application.

Read and clear state

const { error, showError, clearError } = useAppError();

console.log(error.value?.source);
clearError();

An error includes code, statusCode, message, stack, source, info, url, and timestamp.

Errors during SSR

If server rendering fails, Runable records the error and renders app/error.vue in a second pass. The exception therefore does not automatically produce an empty HTML page.

API errors remain in the backend

Express, Fastify, or Hono errors must be converted into HTTP responses by those frameworks. This system concerns the Vue application.

Report an issue Edit this page
Middlewares

Allow, block, or redirect navigation before displaying a page.

Data Fetching

Load data with caching, deduplication, cancellation, and SSR hydration.

On this page

  • 1Display an error manually
  • 2Customize the screen
  • 3Read and clear state
  • 4Errors during SSR
Runable

The Vue framework that brings productive conventions to any backend.

Product

  • Why Runable
  • Documentation
  • Installation
  • Integrations

Project

  • About
  • Blog
  • Changelog
  • Sponsor

Community

  • GitHub
  • Issues
  • Discussions
  • Bluesky

© 2026 Runable. Released under the MIT License.

Open source Built with Vue and Runable