v0.4.8 better errors #9

Open
Quaternions wants to merge 7 commits from staging into master
2 changed files with 3 additions and 2 deletions
Showing only changes of commit c49f9e4dd3 - Show all commits

View File

@ -199,8 +199,9 @@ fn read_readable(mut readable:impl std::io::Read)->std::io::Result<Vec<u8>>{
#[derive(Clone)] #[derive(Clone)]
pub struct Cookie(String); pub struct Cookie(String);
impl Cookie{ impl Cookie{
/// cookie is prepended with ".ROBLOSECURITY=" by this function
pub fn new(cookie:String)->Self{ pub fn new(cookie:String)->Self{
Self(cookie) Self(format!(".ROBLOSECURITY={cookie}"))
} }
pub fn get(self)->String{ pub fn get(self)->String{
self.0 self.0

View File

@ -621,7 +621,7 @@ async fn cookie_from_args(literal:Option<String>,environment:Option<String>,file
(None,None,Some(cookie_file))=>tokio::fs::read_to_string(cookie_file).await?, (None,None,Some(cookie_file))=>tokio::fs::read_to_string(cookie_file).await?,
_=>Err(anyhow::Error::msg("Illegal cookie argument triple"))?, _=>Err(anyhow::Error::msg("Illegal cookie argument triple"))?,
}; };
Ok(Cookie::new(format!(".ROBLOSECURITY={cookie}"))) Ok(Cookie::new(cookie))
} }
async fn api_key_from_args(literal:Option<String>,environment:Option<String>,file:Option<PathBuf>)->AResult<ApiKey>{ async fn api_key_from_args(literal:Option<String>,environment:Option<String>,file:Option<PathBuf>)->AResult<ApiKey>{
let api_key=match (literal,environment,file){ let api_key=match (literal,environment,file){