Improved index out of range exception
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from typing import Optional
|
||||
|
||||
from cpl_query.exceptions import ArgumentNoneException, ExceptionArgument
|
||||
from cpl_query.exceptions import ArgumentNoneException, ExceptionArgument, IndexOutOfRangeException
|
||||
from cpl_query.extension.iterable_abc import IterableABC
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ def first_query(_list: IterableABC) -> any:
|
||||
raise ArgumentNoneException(ExceptionArgument.list)
|
||||
|
||||
if len(_list) == 0:
|
||||
raise Exception('Index out of range')
|
||||
raise IndexOutOfRangeException()
|
||||
|
||||
return _list[0]
|
||||
|
||||
|
Reference in New Issue
Block a user