[logaling-commit] logaling/logaling-command [fix-loga-config] fix raise exception when .logaling.d is empty

Back to archive index

null+****@clear***** null+****@clear*****
Fri Mar 2 17:31:17 JST 2012


SUZUKI Miho	2012-03-02 17:31:17 +0900 (Fri, 02 Mar 2012)

  New Revision: 33fb5a19418ee2d3dfaacc31601fbf279cb710bc

  Log:
    fix raise exception when .logaling.d is empty

  Modified files:
    lib/logaling/command/application.rb
    lib/logaling/glossary.rb

  Modified: lib/logaling/command/application.rb (+2 -0)
===================================================================
--- lib/logaling/command/application.rb    2012-03-02 16:39:40 +0900 (7d388c0)
+++ lib/logaling/command/application.rb    2012-03-02 17:31:17 +0900 (2c06bc9)
@@ -166,6 +166,8 @@ module Logaling::Command
       glossary.add(source_term, target_term, note)
     rescue Logaling::CommandFailed, Logaling::TermError => e
       say e.message
+    rescue Logaling::GlossaryNotFound => e
+      say "Try 'loga new or register' first."
     end
 
     desc 'delete [SOURCE TERM] [TARGET TERM(optional)] [--force(optional)]', 'Delete term.'

  Modified: lib/logaling/glossary.rb (+2 -0)
===================================================================
--- lib/logaling/glossary.rb    2012-03-02 16:39:40 +0900 (2ba6fd3)
+++ lib/logaling/glossary.rb    2012-03-02 17:31:17 +0900 (d0ba653)
@@ -76,6 +76,8 @@ module Logaling
       glossary = Glossary.load_glossary(source_path)
       glossary << build_term(source_term, target_term, note)
       dump_glossary(glossary)
+    rescue
+      raise GlossaryNotFound
     end
 
     def update(source_term, target_term, new_target_term, note)




More information about the logaling-commit mailing list
Back to archive index