Browse Source

Exceptions

pull/152/head
Jure Šorn 1 year ago
parent
commit
ac376ced15
3 changed files with 16 additions and 16 deletions
  1. 12
      README.md
  2. 12
      index.html
  3. 8
      parse.js

12
README.md

@ -1444,8 +1444,8 @@ BaseException
+-- ArithmeticError # Base class for arithmetic errors.
| +-- ZeroDivisionError # Raised when dividing by zero.
+-- AssertionError # Raised by `assert <exp>` if expression returns false value.
+-- AttributeError # Raised when an attribute is missing.
+-- EOFError # Raised by input() when it hits end-of-file condition.
+-- AttributeError # Raised when object doesn't have requested attribute/method.
+-- EOFError # Raised by input() when it hits an end-of-file condition.
+-- LookupError # Base class for errors when a collection can't find an item.
| +-- IndexError # Raised when a sequence index is out of range.
| +-- KeyError # Raised when a dictionary key or set element is missing.
@ -1456,8 +1456,8 @@ BaseException
+-- RuntimeError # Raised by errors that don't fall into other categories.
| +-- RecursionError # Raised when the maximum recursion depth is exceeded.
+-- StopIteration # Raised by next() when run on an empty iterator.
+-- TypeError # Raised when an argument is of wrong type.
+-- ValueError # When an argument is of right type but inappropriate value.
+-- TypeError # Raised when an argument is of the wrong type.
+-- ValueError # When argument has the right type but inappropriate value.
+-- UnicodeError # Raised when encoding/decoding strings to/from bytes fails.
```
@ -1475,8 +1475,8 @@ BaseException
#### Useful built-in exceptions:
```python
raise TypeError('Argument is of wrong type!')
raise ValueError('Argument is of right type but inappropriate value!')
raise TypeError('Argument is of the wrong type!')
raise ValueError('Argument has the right type but an inappropriate value!')
raise RuntimeError('None of above!')
```

12
index.html

@ -1238,8 +1238,8 @@ error_msg = <span class="hljs-string">''</span>.join(traceback.format_exception(
├── ArithmeticError <span class="hljs-comment"># Base class for arithmetic errors.</span>
│ └── ZeroDivisionError <span class="hljs-comment"># Raised when dividing by zero.</span>
├── AssertionError <span class="hljs-comment"># Raised by `assert &lt;exp&gt;` if expression returns false value.</span>
├── AttributeError <span class="hljs-comment"># Raised when an attribute is missing.</span>
├── EOFError <span class="hljs-comment"># Raised by input() when it hits end-of-file condition.</span>
├── AttributeError <span class="hljs-comment"># Raised when object doesn't have requested attribute/method.</span>
├── EOFError <span class="hljs-comment"># Raised by input() when it hits an end-of-file condition.</span>
├── LookupError <span class="hljs-comment"># Base class for errors when a collection can't find an item.</span>
│ ├── IndexError <span class="hljs-comment"># Raised when a sequence index is out of range.</span>
│ └── KeyError <span class="hljs-comment"># Raised when a dictionary key or set element is missing.</span>
@ -1250,8 +1250,8 @@ error_msg = <span class="hljs-string">''</span>.join(traceback.format_exception(
├── RuntimeError <span class="hljs-comment"># Raised by errors that don't fall into other categories.</span>
│ └── RecursionError <span class="hljs-comment"># Raised when the maximum recursion depth is exceeded.</span>
├── StopIteration <span class="hljs-comment"># Raised by next() when run on an empty iterator.</span>
├── TypeError <span class="hljs-comment"># Raised when an argument is of wrong type.</span>
└── ValueError <span class="hljs-comment"># When an argument is of right type but inappropriate value.</span>
├── TypeError <span class="hljs-comment"># Raised when an argument is of the wrong type.</span>
└── ValueError <span class="hljs-comment"># When argument has the right type but inappropriate value.</span>
└── UnicodeError <span class="hljs-comment"># Raised when encoding/decoding strings to/from bytes fails.</span>
</code></pre></div>
@ -1265,8 +1265,8 @@ error_msg = <span class="hljs-string">''</span>.join(traceback.format_exception(
┗━━━━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━┛
</code></pre></div>
<div><h4 id="usefulbuiltinexceptions">Useful built-in exceptions:</h4><pre><code class="python language-python hljs"><span class="hljs-keyword">raise</span> TypeError(<span class="hljs-string">'Argument is of wrong type!'</span>)
<span class="hljs-keyword">raise</span> ValueError(<span class="hljs-string">'Argument is of right type but inappropriate value!'</span>)
<div><h4 id="usefulbuiltinexceptions">Useful built-in exceptions:</h4><pre><code class="python language-python hljs"><span class="hljs-keyword">raise</span> TypeError(<span class="hljs-string">'Argument is of the wrong type!'</span>)
<span class="hljs-keyword">raise</span> ValueError(<span class="hljs-string">'Argument has the right type but an inappropriate value!'</span>)
<span class="hljs-keyword">raise</span> RuntimeError(<span class="hljs-string">'None of above!'</span>)
</code></pre></div>

8
parse.js

@ -371,8 +371,8 @@ const DIAGRAM_7_B =
" ├── ArithmeticError <span class='hljs-comment'># Base class for arithmetic errors.</span>\n" +
" │ └── ZeroDivisionError <span class='hljs-comment'># Raised when dividing by zero.</span>\n" +
" ├── AssertionError <span class='hljs-comment'># Raised by `assert &lt;exp&gt;` if expression returns false value.</span>\n" +
" ├── AttributeError <span class='hljs-comment'># Raised when an attribute is missing.</span>\n" +
" ├── EOFError <span class='hljs-comment'># Raised by input() when it hits end-of-file condition.</span>\n" +
" ├── AttributeError <span class='hljs-comment'># Raised when object doesn't have requested attribute/method.</span>\n" +
" ├── EOFError <span class='hljs-comment'># Raised by input() when it hits an end-of-file condition.</span>\n" +
" ├── LookupError <span class='hljs-comment'># Base class for errors when a collection can't find an item.</span>\n" +
" │ ├── IndexError <span class='hljs-comment'># Raised when a sequence index is out of range.</span>\n" +
" │ └── KeyError <span class='hljs-comment'># Raised when a dictionary key or set element is missing.</span>\n" +
@ -383,8 +383,8 @@ const DIAGRAM_7_B =
" ├── RuntimeError <span class='hljs-comment'># Raised by errors that don't fall into other categories.</span>\n" +
" │ └── RecursionError <span class='hljs-comment'># Raised when the maximum recursion depth is exceeded.</span>\n" +
" ├── StopIteration <span class='hljs-comment'># Raised by next() when run on an empty iterator.</span>\n" +
" ├── TypeError <span class='hljs-comment'># Raised when an argument is of wrong type.</span>\n" +
" └── ValueError <span class='hljs-comment'># When an argument is of right type but inappropriate value.</span>\n" +
" ├── TypeError <span class='hljs-comment'># Raised when an argument is of the wrong type.</span>\n" +
" └── ValueError <span class='hljs-comment'># When argument has the right type but inappropriate value.</span>\n" +
" └── UnicodeError <span class='hljs-comment'># Raised when encoding/decoding strings to/from bytes fails.</span>\n";
const DIAGRAM_8_A =

Loading…
Cancel
Save