File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
apps/desktop/src-tauri/src Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -236,13 +236,21 @@ pub async fn create_or_get_video(
236236 error : String ,
237237 }
238238
239- if let Ok ( error) = response. json :: < CreateErrorResponse > ( ) . await {
239+ let status = response. status ( ) ;
240+ let body = response. text ( ) . await ;
241+
242+ if let Some ( error) = body
243+ . as_ref ( )
244+ . ok ( )
245+ . and_then ( |body| serde_json:: from_str :: < CreateErrorResponse > ( & * body) . ok ( ) )
246+ && status == StatusCode :: FORBIDDEN
247+ {
240248 if error. error == "upgrade_required" {
241249 return Err ( AuthedApiError :: UpgradeRequired ) ;
242250 }
243251 }
244252
245- return Err ( "Unknown error uploading video" . into ( ) ) ;
253+ return Err ( format ! ( "create_or_get_video/ error/{status}: {body:?}" ) . into ( ) ) ;
246254 }
247255
248256 let response_text = response
You can’t perform that action at this time.
0 commit comments