From c6439ee1659de732eaabc568403d39449b1c672d Mon Sep 17 00:00:00 2001 From: philippeitis <33013301+philippeitis@users.noreply.github.com> Date: Sun, 16 Oct 2022 21:38:06 -0700 Subject: [PATCH] Remove .expect() --- src/generator/templates/api/lib/mbuild.mako | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/generator/templates/api/lib/mbuild.mako b/src/generator/templates/api/lib/mbuild.mako index d224dc08bc..033a033481 100644 --- a/src/generator/templates/api/lib/mbuild.mako +++ b/src/generator/templates/api/lib/mbuild.mako @@ -856,7 +856,8 @@ else { start_at: if upload_url_from_server { Some(0) } else { None }, auth: &${auth_call}, user_agent: &self.hub._user_agent, - auth_header: format!("Bearer {}", token.expect("resumable upload requires token").as_str()), + // TODO: Check this assumption + auth_header: format!("Bearer {}", token.ok_or_else(|| client::Error::MissingToken("resumable upload requires token".into()))?.as_str()), url: url_str, reader: &mut reader, media_type: reader_mime_type.clone(),