Skip to content

Commit 1d9bf80

Browse files
committed
[exception] add InvalidSlice exception
1 parent e80984f commit 1d9bf80

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

nixio/exceptions/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from .exceptions import (DuplicateName, UninitializedEntity, InvalidUnit,
22
InvalidAttrType, InvalidEntity, OutOfBounds,
3-
IncompatibleDimensions, InvalidFile,
3+
IncompatibleDimensions, InvalidFile, InvalidSlice,
44
DuplicateColumnName, UnsupportedLinkType)
55

66
__all__ = (

nixio/exceptions/exceptions.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ def __init__(self, *args, **kwargs):
4747
super(InvalidEntity, self).__init__(self.message, *args, **kwargs)
4848

4949

50+
class InvalidSlice(Exception):
51+
52+
def __init__(self, *args, **kwargs):
53+
self.message = "Trying to access data with an invalid slice."
54+
super(InvalidSlice, self).__init__(self.message, *args, **kwargs)
55+
56+
5057
class OutOfBounds(IndexError):
5158

5259
def __init__(self, message, index=None):

0 commit comments

Comments
 (0)