<div class="meta" robots="noindex">

</div>

Method

# Readable.ReadError

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2019r2. Please use `Exception Handling</getting_started/debugging/exception_handling>` as a replacement.

</div>

## Description

Returns `True</api/language/true>` if an error of any type occurred.

## Sample code

This If statement checks for an error after attempting to read from the `BinaryStream</api/files/binarystream>` and displays the error code if <span class="title-ref">ReadError</span> returns `True</api/language/true>`.

``` xojo
Dim readStream As BinaryStream = BinaryStream.Open(readFile, False)
readStream.LittleEndian = True
.
.
If ReadStream.ReadError Then
  MsgBox(Str(readStream.LastErrorCode))
End If
```

## Compatibility

All project types on all supported operating systems.
