 							result = new JS.Uint8Array(result);
 						if (responseType === ResponseType.DATAURI)
 							result = byteArrayToDataUri(new JS.Uint8Array(result), urlRequest.mimeType);
-						
-						resolve(result);
-						done = true;
+
+						if (xhr.status < 200 || xhr.status > 299) /* If we did not receive a success status code (200 OK, 201 Created, etc...), reject */
+						{
+							reject(xhr);
+							done = true;
+						}
+						else
+						{
+							resolve(result);
+							done = true;
+						}
 					};
 					xhr.onerror = function(event:*):void {
 						if (!done)

	import weavejs.util.Dictionary2D;
	import weavejs.util.JS;
	import weavejs.util.StandardLib;
	import weavejs.util.WeavePromise;

	public class URLRequestUtils implements IURLRequestUtils
	{
		private function byteArrayToDataUri(byteArray:/*/Uint8Array/*/Array, mimeType:String):String
		{

 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/.
 * 
 * ***** END LICENSE BLOCK ***** */

package weavejs.net
{
	import weavejs.WeaveAPI;
	import weavejs.api.core.ILinkableHashMap;
	import weavejs.api.core.ILinkableObject;
