recycleactor commited on
Commit
e31f897
·
verified ·
1 Parent(s): 2d79e80

Upload 2 files

Browse files
Files changed (1) hide show
  1. src/main.rs +4 -1
src/main.rs CHANGED
@@ -117,7 +117,10 @@ async fn get_url(State(state): State<AppState>, Json(req): Json<RequestParams>)
117
  }
118
  };
119
 
120
- (StatusCode::OK, media_resp.text().await.unwrap())
 
 
 
121
  }
122
 
123
  #[derive(Debug, Deserialize)]
 
117
  }
118
  };
119
 
120
+ match media_resp.text().await {
121
+ Ok(t) => (StatusCode::OK, t),
122
+ Err(e) => (StatusCode::SERVICE_UNAVAILABLE, e.to_string()),
123
+ }
124
  }
125
 
126
  #[derive(Debug, Deserialize)]