custom event window.onresterror for rest request