From 2c35970ee1bfb36ce95977a91fb6abff1723a145 Mon Sep 17 00:00:00 2001 From: Kevin Southworth Date: Sun, 24 Oct 2021 12:48:44 -0400 Subject: [PATCH 1/2] define MalformedError class --- lib/webvtt.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/webvtt.rb b/lib/webvtt.rb index f8c6c63..9a991ac 100644 --- a/lib/webvtt.rb +++ b/lib/webvtt.rb @@ -3,6 +3,7 @@ module Webvtt # Your code goes here... + class MalformedError < StandardError; end end require 'webvtt/file' From 17e2433bd73ab3593befdc5736426e4befcb09c0 Mon Sep 17 00:00:00 2001 From: Kevin Southworth Date: Sun, 24 Oct 2021 12:53:19 -0400 Subject: [PATCH 2/2] include a malformed error message --- lib/webvtt/file.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/webvtt/file.rb b/lib/webvtt/file.rb index 10706b1..545e4e5 100644 --- a/lib/webvtt/file.rb +++ b/lib/webvtt/file.rb @@ -25,7 +25,7 @@ def initialize(input_file) def parse remove_bom if !webvtt_line?(file.lines.first) - raise Webvtt::MalformedError + raise Webvtt::MalformedError, "Invalid WebVTT file format" end in_header = true collected_lines = []