Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix text error handling #23

Merged
merged 2 commits into from
Sep 11, 2017
Merged

Fix text error handling #23

merged 2 commits into from
Sep 11, 2017

Conversation

timsuchanek
Copy link
Contributor

Currently text responses are not parsed correctly.
This PR turns this:

GraphQL Error (Code: 502):
{"response":{"0":"<","1":"h","2":"t","3":"m","4":"l","5":">","6":"\r","7":"\n","8":"<","9":"h","10":"e","11":"a","12":"d","13":">","14":"<","15":"t","16":"i","17":"t","18":"l","19":"e","20":">","21":"5","22":"0","23":"2","24":"
 ","25":"B","26":"a","27":"d","28":"
 ","29":"G","30":"a","31":"t","32":"e","33":"w","34":"a","35":"y","36":"<","37":"/","38":"t","39":"i","40":"t","41":"l","42":"e","43":">","44":"<","45":"/","46":"h","47":"e","48":"a","49":"d","50":">","51":"\r","52":"\n","53":"<","54":"b","55":"o","56":"d","57":"y","58":" ","59":"b","60":"g","61":"c","62":"o","63":"l","64":"o","65":"r","66":"=","67":"\"","68":"w","69":"h","70":"i","71":"t","72":"e","73":"\"","74":">","75":"\r","76":"\n","77":"<","78":"c","79":"e","80":"n","81":"t","82":"e","83":"r","84":">","85":"<","86":"h","87":"1","88":">","89":"5","90":"0","91":"2","92":"
","93":"B","94":"a","95":"d","96":"
 ","97":"G","98":"a","99":"t","100":"e","101":"w","102":"a","103":"y","104":"<","105":"/","106":"h","107":"1","108":">","109":"<","110":"/","111":"c","112":"e","113":"n","114":"t","115":"e","116":"r","117":">","118":"\r","119":"\n","120":"<","121":"/","122":"b","123":"o","124":"d","125":"y","126":">","127":"\r","128":"\n","129":"<","130":"/","131":"h","132":"t","133":"m","134":"l","135":">","136":"\r","137":"\n","status":502}

into

Error: GraphQL Error (Code: 502): {"response":{"data":"<html>\r\n<head><title>502 Bad Gateway</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>502 Bad Gateway</h1></center>\r\n</body>\r\n</html>\r\n","status":502}

@timsuchanek timsuchanek merged commit bf78f1c into master Sep 11, 2017
@jasonkuhrt jasonkuhrt deleted the text-error branch April 15, 2023 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant