Comments (1)
There was a bug in the exception handling which is now fixed in 0.3.9. Sorry for the long delay in this. Here's what the output will look like with the fix
scala> Http("https://api.instagram.com/v1/users/12895238/?a =b").asString
scalaj.http.HttpException: 400: BAD_REQUEST
at scalaj.http.Http$Request.process(Http.scala:119)
at scalaj.http.Http$Request.apply(Http.scala:96)
at scalaj.http.Http$Request.asString(Http.scala:145)
at .<init>(<console>:9)
at .<clinit>(<console>)
at .<init>(<console>:11)
at .<clinit>(<console>)
at $print(<console>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at scala.tools.nsc.interpreter.IMain$ReadEvalPrint.call(IMain.scala:704)
at scala.tools.nsc.interpreter.IMain$Request.loadAndRun(IMain.scala:914)
at scala.tools.nsc.interpreter.IMain.loadAndRunReq$1(IMain.scala:546)
at scala.tools.nsc.interpreter.IMain.interpret(IMain.scala:577)
at scala.tools.nsc.interpreter.IMain.interpret(IMain.scala:543)
at scala.tools.nsc.interpreter.ILoop.reallyInterpret$1(ILoop.scala:694)
at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:745)
at scala.tools.nsc.interpreter.ILoop.command(ILoop.scala:651)
at scala.tools.nsc.interpreter.ILoop.processLine$1(ILoop.scala:542)
at scala.tools.nsc.interpreter.ILoop.loop(ILoop.scala:550)
at scala.tools.nsc.interpreter.ILoop.process(ILoop.scala:822)
at scala.tools.nsc.interpreter.ILoop.main(ILoop.scala:851)
at xsbt.ConsoleInterface.run(ConsoleInterface.scala:57)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sbt.compiler.AnalyzingCompiler.call(AnalyzingCompiler.scala:73)
at sbt.compiler.AnalyzingCompiler.console(AnalyzingCompiler.scala:64)
at sbt.Console.console0$1(Console.scala:23)
at sbt.Console$$anonfun$apply$2$$anonfun$apply$1.apply$mcV$sp(Console.scala:24)
at sbt.TrapExit$.executeMain$1(TrapExit.scala:33)
at sbt.TrapExit$$anon$1.run(TrapExit.scala:42)
Caused by: java.io.IOException: Server returned HTTP response code: 400 for URL: https://api.instagram.com/v1/users/12895238/?a =b
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1436)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:234)
at scalaj.http.Http$Request$$anonfun$apply$1.apply(Http.scala:96)
at scalaj.http.Http$Request$$anonfun$apply$1.apply(Http.scala:96)
at scalaj.http.Http$Request.process(Http.scala:116)
... 34 more
from scalaj-http.
Related Issues (20)
- any reason it still uses sbt 0.13.x instead of 1.2.x? HOT 2
- publish for Scala 2.13 HOT 1
- Authentication with bearer token not working HOT 1
- data-urlencode option HOT 1
- OAuth1 RSA SHA1 signature support HOT 1
- callback passed to exec invoked 2 times, swallows original exception and passes null as input stream HOT 3
- reflections complicate using scalaj in graal builds
- Support for hostname validation HOT 2
- Custom options HOT 2
- HTTP endpoint that requires a JSON-formatted body HOT 3
- Question: Does the api throw exceptions? HOT 2
- Send a get request with body HOT 3
- scalaj.http.HttpResponse does not take type parameters HOT 3
- Provide Automatic-Module-Name
- Multipart post request fails randomly with error java.io.IOException: insufficient data written
- NoSuchMethodError in runtime for scalaj-http_2.12
- NoClassDefFoundError: Could not initialize class scalaj.http.DefaultConnectFunc$
- HTTP basic authentication in the URL is not available HOT 5
- Cannot GET with JSON -- like curl -X GET -d "jsonKey:jsonVal" HOT 5
- Anything similar for send data as a form body HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scalaj-http.