refactor: return CataloggerError as Results instead of throwing in commands

This commit is contained in:
sam 2025-03-20 15:24:23 +01:00
parent 84c3b42874
commit 8a4e3ff184
Signed by: sam
GPG key ID: 5F3C3C1B3166639D
11 changed files with 57 additions and 36 deletions

View file

@ -13,6 +13,13 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
using Remora.Results;
using RemoraResult = Remora.Results.Result;
namespace Catalogger.Backend;
public class CataloggerError(string message) : Exception(message) { }
public class CataloggerError(string message) : Exception(message), IResultError
{
public static RemoraResult Result(string message) =>
RemoraResult.FromError(new CataloggerError(message));
}