Skip to content

Commit

Permalink
fix: don't truncate error message when not moving
Browse files Browse the repository at this point in the history
  • Loading branch information
revam committed Aug 25, 2024
1 parent 1b8e7df commit caf37e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Shoko.Server/Renamer/RenameFileService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ private AbstractRelocationResult GetNewPath(Func<IBaseRenamer, RelocationEventAr
if (shouldMove && !result.SkipMove && (result.DestinationImportFolder is null || result.Path is null || result.Path.StartsWith("*Error:")))
{
var errorMessage = !string.IsNullOrWhiteSpace(result.Path)
? result.Path[7..].Trim()
? result.Path.StartsWith("*Error:") ? result.Path[7..].Trim() : result.Path
: $"The renamer \"{renamer.GetType().Name}\" could not find a valid destination.";
_logger.LogWarning("An error occurred while trying to find a destination for {FilePath}: {ErrorMessage}", args.File.Path, errorMessage);
return new() { Error = new RelocationError(errorMessage) };
Expand Down

0 comments on commit caf37e3

Please sign in to comment.