Navigation Menu

Skip to content

Commit

Permalink
Format error messages in short style
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Feb 20, 2014
1 parent d0b3e1b commit 93e2c99
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
7 changes: 3 additions & 4 deletions lib/droonga/dispatcher.rb
Expand Up @@ -31,20 +31,19 @@ class Dispatcher

class MissingDatasetParameter < ErrorMessages::BadRequest
def initialize
super("\"dataset\" must be specified.")
super("Missing required parameter: <dataset>")
end
end

class UnknownDataset < ErrorMessages::NotFound
def initialize(dataset)
super("The dataset #{dataset.inspect} does not exist.")
super("Unknown dataset: <#{dataset}>")
end
end

class UnknownCommand < ErrorMessages::BadRequest
def initialize(command, dataset)
super("The command #{command.inspect} is not available " +
"for the dataset #{dataset.inspect}.")
super("[#{dataset}] Handler not found for the type: <#{command}>")
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/droonga/plugin_registry.rb
Expand Up @@ -19,7 +19,7 @@ class PluginRegistry

class UnknownPlugin < Error
def initialize(name, klass)
super("Unknown plugin \"#{name}\" is specified for #{klass}.")
super("[#{klass}] Plugin not found: <#{name}>")
end
end

Expand Down
4 changes: 2 additions & 2 deletions lib/droonga/searcher.rb
Expand Up @@ -32,15 +32,15 @@ def initialize

class MissingSourceParameter < ErrorMessages::BadRequest
def initialize(query, queries)
super("The query #{query.inspect} has no source. " +
super("[#{query}] No source is specified. " +
"Query must have a valid source.",
queries)
end
end

class UnknownSource < ErrorMessages::NotFound
def initialize(source, queries)
super("The source #{source.inspect} does not exist. " +
super("Source not found: <#{source}> " +
"It must be a name of an existing table or another query.",
queries)
end
Expand Down

0 comments on commit 93e2c99

Please sign in to comment.