mirror of
https://github.com/Tyrrrz/CliFx.git
synced 2025-10-25 15:19:17 +00:00
Rename CommandErrorException to CommandException
This commit is contained in:
@@ -40,7 +40,7 @@ namespace CliFx.Demo.Commands
|
||||
Isbn = CreateRandomIsbn();
|
||||
|
||||
if (_libraryService.GetBook(Title) != null)
|
||||
throw new CommandErrorException(1, "Book already exists.");
|
||||
throw new CommandException("Book already exists.", 1);
|
||||
|
||||
var book = new Book(Title, Author, Published, Isbn);
|
||||
_libraryService.AddBook(book);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using System.Threading.Tasks;
|
||||
using CliFx.Attributes;
|
||||
using CliFx.Demo.Internal;
|
||||
using CliFx.Demo.Services;
|
||||
@@ -26,7 +25,7 @@ namespace CliFx.Demo.Commands
|
||||
var book = _libraryService.GetBook(Title);
|
||||
|
||||
if (book == null)
|
||||
throw new CommandErrorException(1, "Book not found.");
|
||||
throw new CommandException("Book not found.", 1);
|
||||
|
||||
console.RenderBook(book);
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using System.Threading.Tasks;
|
||||
using CliFx.Attributes;
|
||||
using CliFx.Demo.Internal;
|
||||
using CliFx.Demo.Services;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using System.Threading.Tasks;
|
||||
using CliFx.Attributes;
|
||||
using CliFx.Demo.Services;
|
||||
using CliFx.Exceptions;
|
||||
@@ -25,7 +24,7 @@ namespace CliFx.Demo.Commands
|
||||
var book = _libraryService.GetBook(Title);
|
||||
|
||||
if (book == null)
|
||||
throw new CommandErrorException(1, "Book not found.");
|
||||
throw new CommandException("Book not found.", 1);
|
||||
|
||||
_libraryService.RemoveBook(book);
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using CliFx.Demo.Models;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
Reference in New Issue
Block a user