Skip to content

Commit

Permalink
Provide better error when preview link is used - Fix #51 (#59)
Browse files Browse the repository at this point in the history
Tweak error message
  • Loading branch information
Buckminsterfullerene02 authored Aug 14, 2023
1 parent 4204ece commit 29c6f46
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/providers/modio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@ impl ModProvider for ModioProvider {
use modio::filter::{Eq, In};
use modio::mods::filters::{Id, NameId, Visible};

if spec.url.contains("?preview=") {
return Err(anyhow!("Preview mod links cannot be added directly, please subscribe to the mod on mod.io and and then use the non-preview link."));
};

let url = &spec.url;
let captures = RE_MOD.captures(url).context("invalid modio URL {url}")?;

Expand Down

0 comments on commit 29c6f46

Please sign in to comment.