소스 검색

fixed wrapped onError crashing with "Uncaught exception - std@buffer_string" when calling request() the second time (retrying) in onError handler

Miha Lunar 11 년 전
부모
커밋
6a5f29c0f3
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      std/haxe/Http.hx

+ 3 - 1
std/haxe/Http.hx

@@ -371,7 +371,9 @@ class Http {
 			me.responseData = output.getBytes().toString();
 			#end
 			err = true;
-			old(e);
+			// Resetting back onError before calling it allows for a second "retry" request to be sent without onError being wrapped twice
+			onError = old;
+			onError(e);
 		}
 		customRequest(post,output);
 		if( !err )