Skip to content

Commit

Permalink
Rename exceptions file to errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
hainesr committed Feb 24, 2024
1 parent c640b1c commit d3fc218
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lib/zip-container.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

require 'zip-container/util'
require 'zip-container/version'
require 'zip-container/exceptions'
require 'zip-container/errors'
require 'zip-container/entries/reserved'
require 'zip-container/entries/managed'
require 'zip-container/entries/entry'
Expand Down
5 changes: 2 additions & 3 deletions lib/zip-container/container.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,8 @@ def self.verify?(filename)
# verify!(filename)
#
# Verify that the specified ZipContainer conforms to the specification.
# This method raises exceptions when errors are found or if there is
# something fundamental wrong with the container itself (e.g. it cannot be
# found).
# This method raises an error if there is something fundamental wrong
# with the container itself (e.g. it cannot be found).
def self.verify!(filename)
new(filename).verify!
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@

##
module ZipContainer
# The base of all exceptions raised by this library.
# The base of all errors raised by this library.
module Error
end

# Shadow Zip::Error so the rubyzip API doesn't leak out.
ZipError = ::Zip::Error
ZipError.include Error

# This exception is raised when a bad Container is detected.
# This error is raised when a bad Container is detected.
class MalformedContainerError < RuntimeError
include Error

Expand All @@ -63,7 +63,7 @@ def initialize(reason = nil)
end
end

# This exception is raised when a clash occurs with a reserved or managed
# This error is raised when a clash occurs with a reserved or managed
# name.
class ReservedNameClashError < RuntimeError
include Error
Expand Down
2 changes: 1 addition & 1 deletion test/exceptions_test.rb → test/errors_test.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2014-2023 The University of Manchester, UK.
# Copyright (c) 2014-2024 The University of Manchester, UK.
#
# All rights reserved.
#
Expand Down
8 changes: 4 additions & 4 deletions test/reserved_names_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def test_replace_mimetype
end
end

# Check that an exception is raised when trying to add file with a reserved
# Check that an error is raised when trying to add file with a reserved
# name.
def test_add_reserved
ZipContainer::File.open(EMPTY_CNTR) do |c|
Expand All @@ -163,7 +163,7 @@ def test_add_reserved
end
end

# Check that an exception is raised when trying to add file with a reserved
# Check that an error is raised when trying to add file with a reserved
# name to a subclassed container.
def test_subclass_add_reserved
NewZipContainer.open(EMPTY_CNTR) do |c|
Expand Down Expand Up @@ -205,7 +205,7 @@ def test_rename_metainf
end
end

# Check that an exception is raised when trying to create a directory with a
# Check that an error is raised when trying to create a directory with a
# reserved name.
def test_mkdir_reserved
ZipContainer::File.open(EMPTY_CNTR) do |c|
Expand All @@ -215,7 +215,7 @@ def test_mkdir_reserved
end
end

# Check that an exception is raised when trying to create a directory with a
# Check that an error is raised when trying to create a directory with a
# reserved name in a subclassed container.
def test_subclass_mkdir_reserved
NewZipContainer.open(EMPTY_CNTR) do |c|
Expand Down

0 comments on commit d3fc218

Please sign in to comment.