refactor: return CataloggerError as Results instead of throwing in commands
This commit is contained in:
parent
84c3b42874
commit
8a4e3ff184
11 changed files with 57 additions and 36 deletions
|
|
@ -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));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue