keecode logokeecode
4

Evaluation Failure

Internal JavaScript evaluation failure

Node.js

Exit Code Information

Exit Code

4

Name

Evaluation Failure

Category

Node.js

Usage Context

JavaScript code failed to return a value

Common Usage

Bash Script

#!/bin/bash

if [ condition ]; then
  echo "Evaluation Failure"
  exit 4
fi

Check Exit Code

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

# Check if exit code matches
if [ $? -eq 4 ]; then
  echo "Evaluation Failure"
fi

Node.js/JavaScript

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

// Or throw error that results in exit code
if (error) {
  console.error('Evaluation Failure');
  process.exit(4);
}

Python

import sys

# Exit with code 4
if error:
    print("Evaluation Failure")
    sys.exit(4)