Better error message for missing metadata
This commit is contained in:
parent
4c7ae4feb2
commit
c2bdd089e9
1 changed files with 8 additions and 2 deletions
|
@ -90,10 +90,16 @@ fn main() {
|
|||
|
||||
let (key, needs_pw) = {
|
||||
let fragment = if let Some(fragment) = url.split_once('#').map(|(_, fragment)| fragment) {
|
||||
if fragment.is_empty() {
|
||||
error!("Key is missing in url; bailing.");
|
||||
render_message("Invalid paste link: Missing metadata.".into());
|
||||
return;
|
||||
} else {
|
||||
fragment
|
||||
}
|
||||
} else {
|
||||
error!("Key is missing in url; bailing.");
|
||||
render_message("Invalid paste link: Missing decryption key.".into());
|
||||
render_message("Invalid paste link: Missing metadata.".into());
|
||||
return;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue