⭐️ A friendly language for building type-safe, scalable systems!
295

Configure Feed

Select the types of activity you want to include in your feed.

Improve Hex API key error message

Co-authored-by: Giacomo Cavalieri <giacomo.cavalieri@icloud.com>

authored by

Moritz Böhme
Giacomo Cavalieri
and committed by
Louis Pilfold
(Jul 10, 2026, 2:04 PM +0100) 7d90f02d 6b993dee

+13 -9
+4
CHANGELOG.md
··· 83 83 via the flag `--package`. 84 84 ([Louis Pilfold](https://github.com/lpil)) 85 85 86 + - The error message when failing to decrypt the local Hex API key is now more 87 + informative and helpful. 88 + ([Moritz Böhme](https://github.com/MoritzBoehme)) 89 + 86 90 ### Language server 87 91 88 92 - The language server now supports go-to-definition, find-references and rename
+1 -3
compiler-cli/src/hex/auth.rs
··· 232 232 encrypted_credentials.refresh_token.as_bytes(), 233 233 &local_password, 234 234 ) 235 - .map_err(|e| Error::FailedToDecryptLocalHexApiKey { 236 - detail: e.to_string(), 237 - })?; 235 + .map_err(|_| Error::FailedToDecryptLocalHexApiKey)?; 238 236 239 237 // Use a refresh token, consuming it to get a new set of tokens. 240 238 let request = hexpm::oauth_refresh_token_request(
+8 -6
compiler-core/src/error.rs
··· 419 419 FailedToEncryptLocalHexApiKey { detail: String }, 420 420 421 421 #[error("Failed to decrypt local Hex API key")] 422 - FailedToDecryptLocalHexApiKey { detail: String }, 422 + FailedToDecryptLocalHexApiKey, 423 423 424 424 #[error("Cannot add a package with the same name as a dependency")] 425 425 CannotAddSelfAsDependency { name: EcoString }, ··· 1909 1909 }] 1910 1910 } 1911 1911 1912 - Error::FailedToDecryptLocalHexApiKey { detail } => { 1912 + Error::FailedToDecryptLocalHexApiKey => { 1913 1913 let text = wrap_format!( 1914 1914 "Unable to decrypt the local Hex API key with the given password. 1915 - The error from the encryption library was: 1916 - 1917 - {detail}" 1915 + Did you make a typo? Please try again." 1918 1916 ); 1919 1917 vec![Diagnostic { 1920 1918 title: "Failed to decrypt local Hex API key".into(), 1921 1919 text, 1922 - hint: None, 1920 + hint: Some( 1921 + "If you have forgotten your local password you can create 1922 + new credentials with `gleam hex authenticate`." 1923 + .into(), 1924 + ), 1923 1925 level: Level::Error, 1924 1926 location: None, 1925 1927 }]