keecode logokeecode
5

Fatal Error

Fatal error in V8

Node.js

Exit Code Information

Exit Code

5

Name

Fatal Error

Category

Node.js

Usage Context

V8 JavaScript engine fatal error

Common Usage

Bash Script

#!/bin/bash

if [ condition ]; then
  echo "Fatal Error"
  exit 5
fi

Check Exit Code

./script.sh
echo $?  # Prints the exit code

# Check if exit code matches
if [ $? -eq 5 ]; then
  echo "Fatal Error"
fi

Node.js/JavaScript

// Exit with code 5
process.exit(5);

// Or throw error that results in exit code
if (error) {
  console.error('Fatal Error');
  process.exit(5);
}

Python

import sys

# Exit with code 5
if error:
    print("Fatal Error")
    sys.exit(5)