Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. def dl: (String => String) = { fileUrl: String => {
  2. val token = getToken();
  3. val response: HttpResponse[String] = Http(fileUrl)
  4. .header("Authorization", "Bearer " + token)
  5. .asString;
  6. try {
  7. retry(4){
  8.  
  9. if (response.code != 200) {
  10. throw new javax.xml.ws.http.HTTPException(response.code)
  11. }
  12. response.body;
  13. }
  14. } catch {
  15. case e: javax.xml.ws.http.HTTPException => {
  16. println("error HTTPException " + e + fileUrl);
  17. "failed";
  18. }
  19. }
  20. }}
  21.  
  22. spray.json.JsonParser$ParsingException: Unexpected character '<' at input index 0 (line 1, position 1), expected JSON Value: <html>?
  23.  
  24. org.apache.spark.sql.functions.get_json_object
  25. DefaultJsonProtocol._
  26. scala.util.parsing.json._
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement