# Handling/Trapping a failing URLLoader

**URL:** <https://forum.kirupa.com/t/handling-trapping-a-failing-urlloader/279590>\
**Category:** flash\
**Created:** [January 16, 2009, 11:27am UTC](https://forum.kirupa.com/t/handling-trapping-a-failing-urlloader/279590 "2009-01-16T11:27:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alize](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@Alize](https://forum.kirupa.com/u/Alize)\
**Post date:** [January 16, 2009, 11:27am UTC](https://forum.kirupa.com/t/handling-trapping-a-failing-urlloader/279590/1 "2009-01-16T11:27:22Z")

</div>

Hey all,

I have coded a small applet that works well, however, if the users connection drops, it can no longer communicate with the server and throws a very nasty looking error message like so:

```auto

Error opening URL 'http://urlhere.com'
            Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: http://urlhere.com
            at Gallery/::switchImages()

```

Here are the lines that break it

```auto

var request:URLRequest = new URLRequest("http://urlhere.com");
loader = new URLLoader(request);
loader.addEventListener(Event.COMPLETE, nextInfoLoaded);

```

I think it is the URLLoader than actually breaks it and throws the error message, I am new to AS3, a book I am using has a whole section dedicated to Error Handling but I have tried and failed to handle this error, can anybody tell me if it is possible to handle this error? As in, if it fails to load the URL, execute another function?
