chore: improve error message when api key not set

This commit is contained in:
Youwen Wu 2024-09-16 19:11:20 -07:00
parent 94d0fb1207
commit b3b8e4b80d
Signed by: youwen5
GPG key ID: 865658ED1FE61EC3

View file

@ -5,7 +5,7 @@ use std::env;
#[tokio::main] #[tokio::main]
async fn main() -> Result<(), Error> { async fn main() -> Result<(), Error> {
let token = let token =
env::var("CANVAS_SECRET").expect("Canvas API key is not defined in the environment."); env::var("CANVAS_SECRET").expect("Canvas API key is not defined in the environment. Please set environment variable `CANVAS_SECRET`.");
// Base URL must have trailing slash or URL `.join()` will not work // Base URL must have trailing slash or URL `.join()` will not work
let client = CanvasClient::create( let client = CanvasClient::create(