Skip to content

Commit 4393ff6

Browse files
committed
docstrings for exceptions
1 parent 06ad2ed commit 4393ff6

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

‎splinter/exceptions.py‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
1+
# -*- coding: utf-8 -*-
2+
13
class DriverNotFoundError(Exception):
4+
"""
5+
Exception raised when a driver is not found.
6+
7+
Example:
8+
9+
>>> from splinter.browser import Browser
10+
>>> b = Browser('unknown driver') # raises DriverNotFoundError
11+
"""
212
pass
313

414

515
class ElementDoesNotExist(Exception):
16+
"""
17+
Exception raised when an element is not found in the page.
18+
19+
The exception is raised only when someone tries to access the element, not when
20+
the driver is finding it.
21+
22+
Example:
23+
24+
>>> elements = browser.find_by_id('unknown-id') # returns an empty list
25+
>>> elements[0] # raises ElementDoesNotExist
26+
"""
627
pass

0 commit comments

Comments
 (0)