Navigation Menu

Skip to content

Commit

Permalink
Define base error class for errors in Droonga
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Feb 12, 2014
1 parent 96224e2 commit fb0f059
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/droonga/catalog.rb
Expand Up @@ -16,12 +16,13 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

require "droonga/catalog_loader"
require "droonga/error"

module Droonga
class << self
attr_accessor :catalog
end

class InvalidCatalog < StandardError
class InvalidCatalog < Error
end
end
21 changes: 21 additions & 0 deletions lib/droonga/error.rb
@@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014 Droonga Project
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License version 2.1 as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

module Droonga
class Error < StandardError
end
end
6 changes: 4 additions & 2 deletions lib/droonga/message_processing_error.rb
@@ -1,4 +1,4 @@
# Copyright (C) 2013 Droonga Project
# Copyright (C) 2013-2014 Droonga Project
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand All @@ -13,8 +13,10 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

require "droonga/error"

module Droonga
class MessageProcessingError < StandardError
class MessageProcessingError < Error
STATUS_CODE = 500

attr_reader :message, :detail
Expand Down

0 comments on commit fb0f059

Please sign in to comment.