Skip to content

Error Codes

GhostTypes edited this page Feb 22, 2026 · 2 revisions

Error Codes Reference

This document provides a comprehensive reference for error codes across FlashForge API interfaces.

HTTP API Error Codes

The HTTP REST API (port 8898) uses a standard JSON response envelope for all endpoints.

Response Format

Success:

{
  "code": 0,
  "message": "Success"
}

Error:

{
  "code": <non-zero>,
  "message": "Error description"
}

HTTP API Code Reference

Code Message Description
0 Success Operation completed successfully
1 Error Generic error occurred
2 Invalid parameter Request payload contains invalid parameters
3 Unauthorized Authentication failed (invalid serial or check code)
4 Not found Requested resource or file not found
5 Busy Printer is busy with another operation

Handling Notes

  • Clients should check code === 0 for success rather than parsing the message string
  • Message case may vary ("Success" vs "success") between firmware versions
  • Error descriptions in the message field may provide additional context

Common Error Scenarios

Code 3 - Unauthorized

Causes:

  • Invalid serialNumber
  • Invalid checkCode
  • Check code has been changed on the printer

Resolution: Verify credentials in printer settings menu.

Code 4 - Not Found

Causes:

  • Requested file does not exist in /printGcode
  • Invalid endpoint path

Resolution: Use /gcodeList to verify available files.

Code 5 - Busy

Causes:

  • Another operation is in progress
  • Printer is performing internal task

Resolution: Wait and retry the operation.

IFS Error Codes (AD5X Only)

These errors appear in /detail responses or blocking dialogs when using the Material Station (Intelligent Filament System).

Feeding Errors

Code Description Trigger
E0100 Channel 1 feeding timeout Load failure (Slot 1)
E0101 Channel 2 feeding timeout Load failure (Slot 2)
E0102 Channel 3 feeding timeout Load failure (Slot 3)
E0103 Channel 4 feeding timeout Load failure (Slot 4)

Retraction Errors

Code Description Trigger
E0104 Channel 1 retracting timeout Unload failure (Slot 1)
E0105 Channel 2 retracting timeout Unload failure (Slot 2)
E0106 Channel 3 retracting timeout Unload failure (Slot 3)
E0107 Channel 4 retracting timeout Unload failure (Slot 4)

System Errors

Code Description Trigger
E0108 Feed failure to extruder Filament sensor timeout during feed
E0109 Odometer stall Filament tangle or jam (stall count > 200)
E0114 IFS homing error Selector mechanism failure

TCP Protocol Errors

Legacy TCP commands (port 8899) return plain text error messages.

Session Errors

Error Message Description
Control Failed Another client is connected or previous session not closed
CMD M601 Received. Control Failed. Session request rejected
Error: have been connected Session already active (M601)

Resolution: Wait for existing session to timeout or ensure M602 was sent before reconnecting.

File Upload Errors

Error Message Description
Error: Not enough space Insufficient storage for file upload (M28)
Error: File Is Not Available File size mismatch during upload (M29)

Resolution:

  • "Not enough space": Delete files from printer storage
  • "File Is Not Available": Verify file size matches M28 parameter, retransmit file

Command Errors

Error Message Description
Error: Invalid command Unknown or malformed command

Detail Response Error Fields

The /detail endpoint may include error information in the response:

{
  "detail": {
    "errorCode": "E0100",
    "status": "error"
  }
}

Checking for Errors

  1. Check status field for value "error"
  2. Inspect errorCode field for specific error code
  3. Cross-reference with error tables above

Error Recovery Strategies

HTTP API Errors

Code Strategy
1 Retry operation, check printer state
2 Validate request payload format
3 Re-authenticate with correct credentials
4 Verify resource exists before requesting
5 Poll /detail until status changes from "busy"

TCP Errors

Error Strategy
Control Failed Wait 30 seconds and retry connection
Not enough space Use HTTP /gcodeList to identify and remove files
File Is Not Available Verify file integrity, retransmit

IFS Errors

Strategy Implementation
Poll status Check matlStationInfo.stateAction during operations
Retry with backoff Implement exponential backoff for transient errors
User notification Display actionable error messages to users
Recovery commands Use ms_cmd with action "cancel" to abort failed operations

Best Practices

Error Handling

  1. Always check response code field, not just HTTP status
  2. Implement retry logic with exponential backoff for codes 1 and 5
  3. Log error codes for debugging and support
  4. Display user-friendly messages based on error context

Timeout Handling

For long-running operations:

  • Use appropriate timeouts (30-60 seconds for most operations)
  • Implement progress polling for file uploads
  • Handle network disconnections gracefully

IFS-Specific Handling

For AD5X material station operations:

  1. Check matlStationInfo.stateAction before starting operations
  2. Monitor state during multi-step operations
  3. Implement error recovery workflows
  4. Clear errors using errorCodeCtrl_cmd if available

Clone this wiki locally