# onneterror command

onneterror is a globally cataloged subroutine
that can be called from the FSI when a network error occurs during
FlashBASIC file I/Os. This allows users to break out of the error
and customize the subroutine.

## Syntax

```
onneterror(environment, operation, errorcode, module, filename, item-ID, action)
```

## Parameter(s)

| environment | Environment in which error occurred. |
| --- | --- |
| 0 | Generic I/O |
| 1 | From VME |
| operation | Operation running when on network error occurred: read write open clear-file select readnext key |
| errorcode | RPC error code. |
| module | Name of the currently running Flash module. |
| filename | File in error. |
| item-ID | Item-ID, if applicable. |
| action | Action to take upon exiting. |
| 0 | Ignore error, and take the else clause, if any. |
| 1 | Abort the program. |
| 2 | Drop into the FlashBASIC debugger. |

## Description

The onneterror subroutine is available in the dm account of the FSI (fsi:dm,basicprograms, onneterror)

## Example(s)

```
:compile bp netter (o
netter
.
[820] Creating FlashBASIC Object (Level 0 ) ...
[241] Successful compile! 3 frame(s) used.
:09:16:50 24 Jan 2006
:off

:run bp netter
to force a NW error, unplug this computer from the NW?
Network Error !!!Running Module "netter"
write item ([//jsmith3]jsmith3:dm/dm 20365 ) cannot bind remote connection

A = Abort / D = Debug / I = Ignore ?i
```

---
Source: https://d3codex.com/tcl/onneterror-command/ - part of the D3Codex reference.
