FM BetterForms
BF Editorfmbetterforms.com
Engineering Reference Docs
Engineering Reference Docs
  • BF Streaming Proxy
  • Updating the Helper File
  • Connection Trouble Shooting Guide
  • Software Testing - Overview
    • Types of Testing
    • UX/UI Checklist
      • Pages
        • Login πŸ”‘
        • Pricing πŸ’΅
        • 404 πŸ€·β€β™‚οΈ
        • Contact Us ☎️
        • Sign Up πŸ‘‹
        • FAQ ❓
        • Blog Post πŸ—ž
        • Careers πŸ’Ό
        • Team πŸ‘«
        • Cart πŸ›’
        • Press πŸ“Έ
        • Search results πŸ”
      • Elements
        • Avatar 😁
        • Badge πŸ“›
        • Button πŸ–²οΈ
        • Card πŸƒ
        • Table πŸ“
        • Icon 🌠
        • Text Field ⌨️
        • Toggle πŸŽ›οΈ
        • Loading ⏳
        • Modal πŸŽ‰
        • Tooltip πŸ› 
        • Search πŸ•΅οΈβ€β™€οΈ
        • Navigation 🧭
        • Radio πŸ“»
        • Checkbox β˜‘οΈ
        • Tabs πŸ—‚
        • Toast 🍞
      • Flows
        • Submitting a form πŸ“¨
        • Making a payment πŸ’³
        • Contacting support πŸ†˜
        • Deleting account πŸ—‘
        • Tracking progress πŸ“ˆ
        • Resetting password 🀫
        • Showing input error 🚨
        • Entering a promo code 🏷️
        • Saving changes πŸ’Ύ
        • Canceling subscription πŸ›‘
      • Topics
        • Responsiveness 🎚
        • Typography πŸ”€
        • Dark mode πŸŒ‘
        • Accessibility 🚹
        • Colors 🎨
        • UX Writing ✏️
      • Brand
        • Logo πŸ’ 
        • Social Media πŸ”‰
        • Typography πŸ” 
    • FM BetterForms - Quality Assurance
    • JavaScript Libraries
  • Rollbacks and Version Control
  • BF Server Proxy
  • Base code End of Life - 0.8.78-0.8111
  • Setting up Auth0
    • Introduction
    • Getting started
      • Creating a tenant
      • Creating Application
      • Additional customizations
        • Allowed Callback URLs
    • Creating a Database
      • Choosing different login options
        • Social Connections
        • Username and password (Auth0)
        • Creating new BF Users
        • Using Auth0 in an iFrame
        • Configuring FM BetterForms
        • Additional Notes
  • Create an S3 Bucket on AWS
  • ApexCharts - Getting started
  • BF Enterprise Documentation
    • Overview
      • Features
      • Overview Diagram
    • Requirements
    • Env File
    • Setting up the Server
      • Installation
      • Loading image to a local repository
      • Starting server
      • Restarting Policies
      • Scaling up
    • Hardware Recommendations
    • FM Credentials - Helper file
    • How it works
      • Development
      • Downloading environment data
  • BetterForms Error Pages API
    • Introduction
    • Dynamic Error Page
    • Static Error Page
    • Custom error pages
    • Custom error handlers
    • Error Code List
  • BF Streaming API
  • Creating a PWA
    • Introduction
    • Getting Started
      • Making it installable
      • Browser Support
      • Sending Push Notifications
      • Sending a Push Notification from the API Endpoint
      • Adding DOM Header Insertion to be Available for Offline Use
Powered by GitBook
On this page

Was this helpful?

  1. BetterForms Error Pages API

Custom error handlers

Besides customizing the error page, you can also customize how all errors are handled and override the default system behavior.

For example, the default β€˜Page Not Found’ error would navigate to the /error page but if you would rather show a toaster alert, the following could be added to the App model.

{
	"errorHandlers": [{
        "actions": [{
            "action": "showAlert",
            "function": "action.options.text = action.options.error.message",
            "options": {
                "text": "",
                "title": "Error",
                "type": "error"
            }
        }],
        "codes": ["404"]
    }]
}

As it can be seen above, custom behaviours are added under a reserved global actions key errorHandlers, and that will be an array of objects. Each object having have codes and actions.

Key
Value

codes

array of error codes that the associated actions will run with.

actions

array of actions

The result from the example code above is the alert shown below.

Key
Path

code

actions.options.error.code

description

actions.options.error.description

message

actions.options.error.message

PreviousCustom error pagesNextError Code List

Last updated 10 months ago

Was this helpful?

The error data can be found under options for each action of the array, for a given code. The error object has the same shape as previously presented and can be accessed as follows:

here