@@ -0,0 +1,17 @@
|
||||
package ru.soune.nocopy.exception;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public class ModerationReasonInUseException extends RuntimeException {
|
||||
private final Long reasonId;
|
||||
private final Long usageCount;
|
||||
|
||||
public ModerationReasonInUseException(Long reasonId, Long usageCount) {
|
||||
super(String.format("Cannot delete moderation reason %d because it is used by %d files",
|
||||
reasonId, usageCount));
|
||||
this.reasonId = reasonId;
|
||||
this.usageCount = usageCount;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package ru.soune.nocopy.exception;
|
||||
|
||||
public class ModerationReasonNotFoundException extends RuntimeException {
|
||||
public ModerationReasonNotFoundException(Long id) {
|
||||
super("Moderation reason not found with id: " + id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user