lib/nexus_cli/errors.rb in nexus_cli-0.5.0 vs lib/nexus_cli/errors.rb in nexus_cli-0.6.0

- old
+ new

@@ -99,11 +99,11 @@ end def message %{Your global_settings.json file is malformed and could not be uploaded to Nexus. The output from the server was: - #{@server_response}} +#{@server_response}} end status_code(111) end class CreateRepsitoryException < NexusCliError @@ -111,11 +111,11 @@ @server_response = JSON.pretty_generate(JSON.parse(body)) end def message %{Your create repository command failed due to the following: - #{@server_response}} +#{@server_response}} end status_code(112) end class RepositoryDoesNotExistException < NexusCliError @@ -147,6 +147,48 @@ def message "Submit your tag request specifying one or more 2 colon-separated values: `key:value`. The key can only consist of alphanumeric characters." end status_code(116) end -end + + class CreateUserException < NexusCliError + def initialize(body) + @server_response = JSON.pretty_generate(JSON.parse(body)) + end + + def message + %{Your create user command failed due to the following: +#{@server_response}} + end + status_code(117) + end + + class UserNotFoundException < NexusCliError + def initialize(id) + @id = id + end + + def message + "A user with the ID of #{@id} could not be found. Please ensure it exists." + end + status_code(118) + end + + class UpdateUserException < NexusCliError + def initialize(body) + @server_response = JSON.pretty_generate(JSON.parse(body)) + end + + def message + %{Your update user command failed due to the following: +#{@server_response}} + end + status_code(119) + end + + class InvalidCredentialsException < NexusCliError + def message + "Invalid Credentials were supplied. Please make sure you are passing the correct values." + end + status_code(120) + end +end \ No newline at end of file