Permalink
Browse files

'har' executable prints error messages nicely

  • Loading branch information...
1 parent aa2359a commit 620ab234434755346a5d0cd810ee2d78d51bbff0 @jarib committed Jan 10, 2011
Showing with 11 additions and 6 deletions.
  1. +6 −1 bin/har
  2. +1 −5 lib/har.rb
  3. +4 −0 lib/har/error.rb
View
@@ -1,4 +1,9 @@
#!/usr/bin/env ruby
require "har"
-HAR::Viewer.new(ARGV).show
+
+begin
+ HAR::Viewer.new(ARGV).show
+rescue HAR::Error => ex
+ abort "\n\n#{ex.message}"
+end
View
@@ -2,11 +2,7 @@
require 'json-schema'
require 'time'
-module HAR
- class Error < StandardError; end
- class ValidationError < StandardError; end
-end
-
+require 'har/error'
require 'har/version'
require 'har/serializable'
require 'har/schema_type'
View
@@ -0,0 +1,4 @@
+module HAR
+ class Error < StandardError; end
+ class ValidationError < Error; end
+end

0 comments on commit 620ab23

Please sign in to comment.