exceptions.html 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <!-- This file is generated by Nim. -->
  4. <html xmlns="https://www.w3.org/1999/xhtml" xml:lang="en" lang="en" data-theme="auto">
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  8. <title>system/exceptions</title>
  9. <!-- Google fonts -->
  10. <link href='https://fonts.googleapis.com/css?family=Lato:400,600,900' rel='stylesheet' type='text/css'/>
  11. <link href='https://fonts.googleapis.com/css?family=Source+Code+Pro:400,500,600' rel='stylesheet' type='text/css'/>
  12. <!-- Favicon -->
  13. <link rel="shortcut icon" href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAUAAAAF////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAIAAABbAAAAlQAAAKIAAACbAAAAmwAAAKIAAACVAAAAWwAAAAL///8A////AP///wD///8A////AAAAABQAAADAAAAAYwAAAA3///8A////AP///wD///8AAAAADQAAAGMAAADAAAAAFP///wD///8A////AP///wAAAACdAAAAOv///wD///8A////AP///wD///8A////AP///wD///8AAAAAOgAAAJ3///8A////AP///wAAAAAnAAAAcP///wAAAAAoAAAASv///wD///8A////AP///wAAAABKAAAAKP///wAAAABwAAAAJ////wD///8AAAAAgQAAABwAAACIAAAAkAAAAJMAAACtAAAAFQAAABUAAACtAAAAkwAAAJAAAACIAAAAHAAAAIH///8A////AAAAAKQAAACrAAAAaP///wD///8AAAAARQAAANIAAADSAAAARf///wD///8AAAAAaAAAAKsAAACk////AAAAADMAAACcAAAAnQAAABj///8A////AP///wAAAAAYAAAAGP///wD///8A////AAAAABgAAACdAAAAnAAAADMAAAB1AAAAwwAAAP8AAADpAAAAsQAAAE4AAAAb////AP///wAAAAAbAAAATgAAALEAAADpAAAA/wAAAMMAAAB1AAAAtwAAAOkAAAD/AAAA/wAAAP8AAADvAAAA3gAAAN4AAADeAAAA3gAAAO8AAAD/AAAA/wAAAP8AAADpAAAAtwAAAGUAAAA/AAAA3wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAADfAAAAPwAAAGX///8A////AAAAAEgAAADtAAAAvwAAAL0AAADGAAAA7wAAAO8AAADGAAAAvQAAAL8AAADtAAAASP///wD///8A////AP///wD///8AAAAAO////wD///8A////AAAAAIcAAACH////AP///wD///8AAAAAO////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A//8AAP//AAD4HwAA7/cAAN/7AAD//wAAoYUAAJ55AACf+QAAh+EAAAAAAADAAwAA4AcAAP5/AAD//wAA//8AAA=="/>
  14. <link rel="icon" type="image/png" sizes="32x32" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH4QQQEwksSS9ZWwAAAk1JREFUWMPtll2ITVEUx39nn/O7Y5qR8f05wtCUUr6ZIS++8pEnkZInPImneaCQ5METNdOkeFBKUhMPRIkHKfEuUZSUlGlKPN2TrgfncpvmnntnmlEyq1Z7t89/rf9a6+y99oZxGZf/XeIq61EdtgKXgdXA0xrYAvBjOIF1AI9zvjcC74BSpndrJPkBWDScTF8Aa4E3wDlgHbASaANmVqlcCnwHvgDvgVfAJ+AikAAvgfVZwLnSVZHZaOuKoQi3ZOMi4NkYkpe1p4J7A8BpYAD49hfIy/oqG0+hLomiKP2L5L+1ubn5115S+3OAn4EnwBlgMzCjyt6ZAnQCJ4A7wOs88iRJHvw50HoujuPBoCKwHWiosy8MdfZnAdcHk8dxXFJ3VQbQlCTJvRBCGdRbD4M6uc5glpY3eAihpN5S5w12diSEcCCEcKUO4ljdr15T76ur1FDDLIQQ3qv71EdDOe3Kxj3leRXyk+pxdWnFWod6Wt2bY3de3aSuUHcPBVimHs7mK9WrmeOF6lR1o9qnzskh2ar2qm1qizpfXaPeVGdlmGN5pb09qMxz1Xb1kLqgzn1RyH7JUXW52lr5e/Kqi9qpto7V1atuUzfnARrV7jEib1T76gG2qxdGmXyiekkt1GswPTtek0aBfJp6YySGBfWg2tPQ0FAYgf1stUfdmdcjarbYJEniKIq6gY/Aw+zWHAC+p2labGpqiorFYgGYCEzN7oQdQClN07O1/EfDyGgC0ALMBdYAi4FyK+4H3gLPsxfR1zRNi+NP7nH5J+QntnXe5B5mpfQAAAAASUVORK5CYII=">
  15. <!-- CSS -->
  16. <link rel="stylesheet" type="text/css" href="nimdoc.out.css?v=2.3.1">
  17. <!-- JS -->
  18. <script type="text/javascript" src="dochack.js?v=2.3.1"></script>
  19. </head>
  20. <body>
  21. <div class="document" id="documentId">
  22. <div class="container">
  23. <h1 class="title">system/exceptions</h1>
  24. <div class="row">
  25. <div class="three columns">
  26. <div class="theme-select-wrapper">
  27. <label for="theme-select">Theme:&nbsp;</label>
  28. <select id="theme-select" onchange="setTheme(this.value)">
  29. <option value="auto">🌗 Match OS</option>
  30. <option value="dark">🌑 Dark</option>
  31. <option value="light">🌕 Light</option>
  32. </select>
  33. </div>
  34. <div id="global-links">
  35. <ul class="simple-boot">
  36. <li><a href="manual.html">Manual</a></li>
  37. <li><a href="lib.html">Standard library</a></li>
  38. <li> <a id="indexLink" href="theindex.html">Index</a></li>
  39. <li><a href="compiler/theindex.html">Compiler docs</a></li>
  40. <li><a href="https://nim-lang.github.io/fusion/theindex.html">Fusion docs</a></li>
  41. <li><a href="https://nim-lang.github.io/Nim/">devel</a>, <a href="https://nim-lang.org/documentation.html">stable</a></li>
  42. </ul>
  43. </div>
  44. <div id="searchInputDiv">
  45. Search: <input type="search" id="searchInput"
  46. oninput="search()" />
  47. </div>
  48. <ul class="simple simple-toc" id="toc-list">
  49. <li>
  50. <details open>
  51. <summary><a class="reference reference-toplevel" href="#7" id="57">Types</a></summary>
  52. <ul class="simple simple-toc-section">
  53. <li><a class="reference" href="#AccessViolationDefect" title="AccessViolationDefect = object of Defect">AccessViolationDefect</a></li>
  54. <li><a class="reference" href="#ArithmeticDefect" title="ArithmeticDefect = object of Defect">ArithmeticDefect</a></li>
  55. <li><a class="reference" href="#AssertionDefect" title="AssertionDefect = object of Defect">AssertionDefect</a></li>
  56. <li><a class="reference" href="#DeadThreadDefect" title="DeadThreadDefect = object of Defect">DeadThreadDefect</a></li>
  57. <li><a class="reference" href="#DivByZeroDefect" title="DivByZeroDefect = object of ArithmeticDefect">DivByZeroDefect</a></li>
  58. <li><a class="reference" href="#EOFError" title="EOFError = object of IOError">EOFError</a></li>
  59. <li><a class="reference" href="#ExecIOEffect" title="ExecIOEffect = object of IOEffect">ExecIOEffect</a></li>
  60. <li><a class="reference" href="#FieldDefect" title="FieldDefect = object of Defect">FieldDefect</a></li>
  61. <li><a class="reference" href="#FloatDivByZeroDefect" title="FloatDivByZeroDefect = object of FloatingPointDefect">FloatDivByZeroDefect</a></li>
  62. <li><a class="reference" href="#FloatInexactDefect" title="FloatInexactDefect = object of FloatingPointDefect">FloatInexactDefect</a></li>
  63. <li><a class="reference" href="#FloatingPointDefect" title="FloatingPointDefect = object of Defect">FloatingPointDefect</a></li>
  64. <li><a class="reference" href="#FloatInvalidOpDefect" title="FloatInvalidOpDefect = object of FloatingPointDefect">FloatInvalidOpDefect</a></li>
  65. <li><a class="reference" href="#FloatOverflowDefect" title="FloatOverflowDefect = object of FloatingPointDefect">FloatOverflowDefect</a></li>
  66. <li><a class="reference" href="#FloatUnderflowDefect" title="FloatUnderflowDefect = object of FloatingPointDefect">FloatUnderflowDefect</a></li>
  67. <li><a class="reference" href="#IndexDefect" title="IndexDefect = object of Defect">IndexDefect</a></li>
  68. <li><a class="reference" href="#IOEffect" title="IOEffect = object of RootEffect">IOEffect</a></li>
  69. <li><a class="reference" href="#IOError" title="IOError = object of CatchableError">IOError</a></li>
  70. <li><a class="reference" href="#KeyError" title="KeyError = object of ValueError">KeyError</a></li>
  71. <li><a class="reference" href="#LibraryError" title="LibraryError = object of OSError">LibraryError</a></li>
  72. <li><a class="reference" href="#NilAccessDefect" title="NilAccessDefect = object of Defect">NilAccessDefect</a></li>
  73. <li><a class="reference" href="#ObjectAssignmentDefect" title="ObjectAssignmentDefect = object of Defect">ObjectAssignmentDefect</a></li>
  74. <li><a class="reference" href="#ObjectConversionDefect" title="ObjectConversionDefect = object of Defect">ObjectConversionDefect</a></li>
  75. <li><a class="reference" href="#OSError" title="OSError = object of CatchableError
  76. errorCode*: int32 ## OS-defined error code describing this error.">OSError</a></li>
  77. <li><a class="reference" href="#OutOfMemDefect" title="OutOfMemDefect = object of Defect">OutOfMemDefect</a></li>
  78. <li><a class="reference" href="#OverflowDefect" title="OverflowDefect = object of ArithmeticDefect">OverflowDefect</a></li>
  79. <li><a class="reference" href="#RangeDefect" title="RangeDefect = object of Defect">RangeDefect</a></li>
  80. <li><a class="reference" href="#ReadIOEffect" title="ReadIOEffect = object of IOEffect">ReadIOEffect</a></li>
  81. <li><a class="reference" href="#ReraiseDefect" title="ReraiseDefect = object of Defect">ReraiseDefect</a></li>
  82. <li><a class="reference" href="#ResourceExhaustedError" title="ResourceExhaustedError = object of CatchableError">ResourceExhaustedError</a></li>
  83. <li><a class="reference" href="#StackOverflowDefect" title="StackOverflowDefect = object of Defect">StackOverflowDefect</a></li>
  84. <li><a class="reference" href="#TimeEffect" title="TimeEffect = object of RootEffect">TimeEffect</a></li>
  85. <li><a class="reference" href="#ValueError" title="ValueError = object of CatchableError">ValueError</a></li>
  86. <li><a class="reference" href="#WriteIOEffect" title="WriteIOEffect = object of IOEffect">WriteIOEffect</a></li>
  87. </ul>
  88. </details>
  89. </li>
  90. </ul>
  91. </div>
  92. <div class="nine columns" id="content">
  93. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/exceptions.nim#L1" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  94. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L1" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  95. <div id="tocRoot"></div>
  96. <p class="module-desc">Exception and effect types used in Nim code.</p>
  97. <div class="section" id="7">
  98. <h1><a class="toc-backref" href="#7">Types</a></h1>
  99. <dl class="item">
  100. <div id="AccessViolationDefect">
  101. <dt><pre><a href="exceptions.html#AccessViolationDefect"><span class="Identifier">AccessViolationDefect</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="system.html#Defect"><span class="Identifier">Defect</span></a></pre></dt>
  102. <dd>
  103. Raised for invalid memory access errors
  104. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/exceptions.nim#L32" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  105. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L32" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  106. </dd>
  107. </div>
  108. <div id="ArithmeticDefect">
  109. <dt><pre><a href="exceptions.html#ArithmeticDefect"><span class="Identifier">ArithmeticDefect</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="system.html#Defect"><span class="Identifier">Defect</span></a></pre></dt>
  110. <dd>
  111. Raised if any kind of arithmetic error occurred.
  112. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/exceptions.nim#L22" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  113. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L22" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  114. </dd>
  115. </div>
  116. <div id="AssertionDefect">
  117. <dt><pre><a href="exceptions.html#AssertionDefect"><span class="Identifier">AssertionDefect</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="system.html#Defect"><span class="Identifier">Defect</span></a></pre></dt>
  118. <dd>
  119. <p>
  120. Raised when assertion is proved wrong.</p>
  121. <p>Usually the result of using the <a class="reference external" href="assertions.html#assert.t,untyped,string">assert() template</a>.</p>
  122. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/exceptions.nim#L34" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  123. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L34" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  124. </dd>
  125. </div>
  126. <div id="DeadThreadDefect">
  127. <dt><pre><a href="exceptions.html#DeadThreadDefect"><span class="Identifier">DeadThreadDefect</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="system.html#Defect"><span class="Identifier">Defect</span></a></pre></dt>
  128. <dd>
  129. Raised if it is attempted to send a message to a dead thread.
  130. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/exceptions.nim#L92" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  131. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L92" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  132. </dd>
  133. </div>
  134. <div id="DivByZeroDefect">
  135. <dt><pre><a href="exceptions.html#DivByZeroDefect"><span class="Identifier">DivByZeroDefect</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="exceptions.html#ArithmeticDefect"><span class="Identifier">ArithmeticDefect</span></a></pre></dt>
  136. <dd>
  137. Raised for runtime integer divide-by-zero errors.
  138. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/exceptions.nim#L24" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  139. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L24" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  140. </dd>
  141. </div>
  142. <div id="EOFError">
  143. <dt><pre><a href="exceptions.html#EOFError"><span class="Identifier">EOFError</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="exceptions.html#IOError"><span class="Identifier">IOError</span></a></pre></dt>
  144. <dd>
  145. Raised if an IO &quot;end of file&quot; error occurred.
  146. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/exceptions.nim#L13" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  147. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L13" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  148. </dd>
  149. </div>
  150. <div id="ExecIOEffect">
  151. <dt><pre><a href="exceptions.html#ExecIOEffect"><span class="Identifier">ExecIOEffect</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="exceptions.html#IOEffect"><span class="Identifier">IOEffect</span></a></pre></dt>
  152. <dd>
  153. Effect describing an executing IO operation.
  154. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/exceptions.nim#L8" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  155. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L8" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  156. </dd>
  157. </div>
  158. <div id="FieldDefect">
  159. <dt><pre><a href="exceptions.html#FieldDefect"><span class="Identifier">FieldDefect</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="system.html#Defect"><span class="Identifier">Defect</span></a></pre></dt>
  160. <dd>
  161. Raised if a record field is not accessible because its discriminant's value does not fit.
  162. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/exceptions.nim#L52" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  163. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L52" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  164. </dd>
  165. </div>
  166. <div id="FloatDivByZeroDefect">
  167. <dt><pre><a href="exceptions.html#FloatDivByZeroDefect"><span class="Identifier">FloatDivByZeroDefect</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="exceptions.html#FloatingPointDefect"><span class="Identifier">FloatingPointDefect</span></a></pre></dt>
  168. <dd>
  169. <p>
  170. Raised by division by zero.</p>
  171. <p>Divisor is zero and dividend is a finite nonzero number.</p>
  172. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/exceptions.nim#L72" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  173. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L72" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  174. </dd>
  175. </div>
  176. <div id="FloatInexactDefect">
  177. <dt><pre><a href="exceptions.html#FloatInexactDefect"><span class="Identifier">FloatInexactDefect</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="exceptions.html#FloatingPointDefect"><span class="Identifier">FloatingPointDefect</span></a></pre></dt>
  178. <dd>
  179. <p>
  180. Raised for inexact results.</p>
  181. <p>The operation produced a result that cannot be represented with infinite precision -- for example: <tt class="docutils literal"><span class="pre"><span class="FloatNumber">2.0</span> <span class="Operator">/</span> <span class="FloatNumber">3.0</span><span class="Punctuation">,</span> <span class="Identifier">log</span><span class="Punctuation">(</span><span class="FloatNumber">1.1</span><span class="Punctuation">)</span></span></tt></p>
  182. <p><strong>Note</strong>: Nim currently does not detect these!</p>
  183. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/exceptions.nim#L85" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  184. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L85" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  185. </dd>
  186. </div>
  187. <div id="FloatingPointDefect">
  188. <dt><pre><a href="exceptions.html#FloatingPointDefect"><span class="Identifier">FloatingPointDefect</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="system.html#Defect"><span class="Identifier">Defect</span></a></pre></dt>
  189. <dd>
  190. Base class for floating point exceptions.
  191. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/exceptions.nim#L66" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  192. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L66" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  193. </dd>
  194. </div>
  195. <div id="FloatInvalidOpDefect">
  196. <dt><pre><a href="exceptions.html#FloatInvalidOpDefect"><span class="Identifier">FloatInvalidOpDefect</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="exceptions.html#FloatingPointDefect"><span class="Identifier">FloatingPointDefect</span></a></pre></dt>
  197. <dd>
  198. <p>
  199. Raised by invalid operations according to IEEE.</p>
  200. <p>Raised by <tt class="docutils literal"><span class="pre"><span class="FloatNumber">0.0</span><span class="Operator">/</span><span class="FloatNumber">0.0</span></span></tt>, for example.</p>
  201. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/exceptions.nim#L68" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  202. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L68" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  203. </dd>
  204. </div>
  205. <div id="FloatOverflowDefect">
  206. <dt><pre><a href="exceptions.html#FloatOverflowDefect"><span class="Identifier">FloatOverflowDefect</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="exceptions.html#FloatingPointDefect"><span class="Identifier">FloatingPointDefect</span></a></pre></dt>
  207. <dd>
  208. <p>
  209. Raised for overflows.</p>
  210. <p>The operation produced a result that exceeds the range of the exponent.</p>
  211. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/exceptions.nim#L76" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  212. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L76" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  213. </dd>
  214. </div>
  215. <div id="FloatUnderflowDefect">
  216. <dt><pre><a href="exceptions.html#FloatUnderflowDefect"><span class="Identifier">FloatUnderflowDefect</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="exceptions.html#FloatingPointDefect"><span class="Identifier">FloatingPointDefect</span></a></pre></dt>
  217. <dd>
  218. <p>
  219. Raised for underflows.</p>
  220. <p>The operation produced a result that is too small to be represented as a normal number.</p>
  221. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/exceptions.nim#L80" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  222. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L80" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  223. </dd>
  224. </div>
  225. <div id="IndexDefect">
  226. <dt><pre><a href="exceptions.html#IndexDefect"><span class="Identifier">IndexDefect</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="system.html#Defect"><span class="Identifier">Defect</span></a></pre></dt>
  227. <dd>
  228. Raised if an array index is out of bounds.
  229. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/exceptions.nim#L49" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  230. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L49" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  231. </dd>
  232. </div>
  233. <div id="IOEffect">
  234. <dt><pre><a href="exceptions.html#IOEffect"><span class="Identifier">IOEffect</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="system.html#RootEffect"><span class="Identifier">RootEffect</span></a></pre></dt>
  235. <dd>
  236. IO effect.
  237. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/exceptions.nim#L5" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  238. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L5" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  239. </dd>
  240. </div>
  241. <div id="IOError">
  242. <dt><pre><a href="exceptions.html#IOError"><span class="Identifier">IOError</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="system.html#CatchableError"><span class="Identifier">CatchableError</span></a></pre></dt>
  243. <dd>
  244. Raised if an IO error occurred.
  245. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/exceptions.nim#L11" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  246. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L11" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  247. </dd>
  248. </div>
  249. <div id="KeyError">
  250. <dt><pre><a href="exceptions.html#KeyError"><span class="Identifier">KeyError</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="exceptions.html#ValueError"><span class="Identifier">ValueError</span></a></pre></dt>
  251. <dd>
  252. <p>
  253. Raised if a key cannot be found in a table.</p>
  254. <p>Mostly used by the <a class="reference external" href="tables.html">tables</a> module, it can also be raised by other collection modules like <a class="reference external" href="sets.html">sets</a> or <a class="reference external" href="strtabs.html">strtabs</a>.</p>
  255. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/exceptions.nim#L41" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  256. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L41" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  257. </dd>
  258. </div>
  259. <div id="LibraryError">
  260. <dt><pre><a href="exceptions.html#LibraryError"><span class="Identifier">LibraryError</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="exceptions.html#OSError"><span class="Identifier">OSError</span></a></pre></dt>
  261. <dd>
  262. Raised if a dynamic library could not be loaded.
  263. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/exceptions.nim#L18" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  264. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L18" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  265. </dd>
  266. </div>
  267. <div id="NilAccessDefect">
  268. <dt><pre><a href="exceptions.html#NilAccessDefect"><span class="Identifier">NilAccessDefect</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="system.html#Defect"><span class="Identifier">Defect</span></a></pre></dt>
  269. <dd>
  270. <p>
  271. Raised on dereferences of <tt class="docutils literal"><span class="pre"><span class="Keyword">nil</span></span></tt> pointers.</p>
  272. <p>This is only raised if the <a class="reference external" href="segfaults.html">segfaults module</a> was imported!</p>
  273. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/exceptions.nim#L94" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  274. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L94" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  275. </dd>
  276. </div>
  277. <div id="ObjectAssignmentDefect">
  278. <dt><pre><a href="exceptions.html#ObjectAssignmentDefect"><span class="Identifier">ObjectAssignmentDefect</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="system.html#Defect"><span class="Identifier">Defect</span></a></pre></dt>
  279. <dd>
  280. Raised if an object gets assigned to its parent's object.
  281. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/exceptions.nim#L61" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  282. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L61" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  283. </dd>
  284. </div>
  285. <div id="ObjectConversionDefect">
  286. <dt><pre><a href="exceptions.html#ObjectConversionDefect"><span class="Identifier">ObjectConversionDefect</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="system.html#Defect"><span class="Identifier">Defect</span></a></pre></dt>
  287. <dd>
  288. Raised if an object is converted to an incompatible object type. You can use <tt class="docutils literal"><span class="pre"><span class="Keyword">of</span></span></tt> operator to check if conversion will succeed.
  289. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/exceptions.nim#L63" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  290. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L63" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  291. </dd>
  292. </div>
  293. <div id="OSError">
  294. <dt><pre><a href="exceptions.html#OSError"><span class="Identifier">OSError</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="system.html#CatchableError"><span class="Identifier">CatchableError</span></a>
  295. <span class="Identifier">errorCode</span><span class="Operator">*</span><span class="Other">:</span> <a href="system.html#int32"><span class="Identifier">int32</span></a> <span class="Comment">## OS-defined error code describing this error.</span></pre></dt>
  296. <dd>
  297. Raised if an operating system service failed.
  298. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/exceptions.nim#L15" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  299. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L15" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  300. </dd>
  301. </div>
  302. <div id="OutOfMemDefect">
  303. <dt><pre><a href="exceptions.html#OutOfMemDefect"><span class="Identifier">OutOfMemDefect</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="system.html#Defect"><span class="Identifier">Defect</span></a></pre></dt>
  304. <dd>
  305. Raised for unsuccessful attempts to allocate memory.
  306. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/exceptions.nim#L47" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  307. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L47" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  308. </dd>
  309. </div>
  310. <div id="OverflowDefect">
  311. <dt><pre><a href="exceptions.html#OverflowDefect"><span class="Identifier">OverflowDefect</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="exceptions.html#ArithmeticDefect"><span class="Identifier">ArithmeticDefect</span></a></pre></dt>
  312. <dd>
  313. <p>
  314. Raised for runtime integer overflows.</p>
  315. <p>This happens for calculations whose results are too large to fit in the provided bits.</p>
  316. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/exceptions.nim#L27" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  317. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L27" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  318. </dd>
  319. </div>
  320. <div id="RangeDefect">
  321. <dt><pre><a href="exceptions.html#RangeDefect"><span class="Identifier">RangeDefect</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="system.html#Defect"><span class="Identifier">Defect</span></a></pre></dt>
  322. <dd>
  323. Raised if a range check error occurred.
  324. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/exceptions.nim#L55" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  325. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L55" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  326. </dd>
  327. </div>
  328. <div id="ReadIOEffect">
  329. <dt><pre><a href="exceptions.html#ReadIOEffect"><span class="Identifier">ReadIOEffect</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="exceptions.html#IOEffect"><span class="Identifier">IOEffect</span></a></pre></dt>
  330. <dd>
  331. Effect describing a read IO operation.
  332. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/exceptions.nim#L6" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  333. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L6" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  334. </dd>
  335. </div>
  336. <div id="ReraiseDefect">
  337. <dt><pre><a href="exceptions.html#ReraiseDefect"><span class="Identifier">ReraiseDefect</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="system.html#Defect"><span class="Identifier">Defect</span></a></pre></dt>
  338. <dd>
  339. Raised if there is no exception to reraise.
  340. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/exceptions.nim#L59" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  341. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L59" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  342. </dd>
  343. </div>
  344. <div id="ResourceExhaustedError">
  345. <dt><pre><a href="exceptions.html#ResourceExhaustedError"><span class="Identifier">ResourceExhaustedError</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="system.html#CatchableError"><span class="Identifier">CatchableError</span></a></pre></dt>
  346. <dd>
  347. Raised if a resource request could not be fulfilled.
  348. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/exceptions.nim#L20" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  349. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L20" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  350. </dd>
  351. </div>
  352. <div id="StackOverflowDefect">
  353. <dt><pre><a href="exceptions.html#StackOverflowDefect"><span class="Identifier">StackOverflowDefect</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="system.html#Defect"><span class="Identifier">Defect</span></a></pre></dt>
  354. <dd>
  355. Raised if the hardware stack used for subroutine calls overflowed.
  356. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/exceptions.nim#L57" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  357. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L57" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  358. </dd>
  359. </div>
  360. <div id="TimeEffect">
  361. <dt><pre><a href="exceptions.html#TimeEffect"><span class="Identifier">TimeEffect</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="system.html#RootEffect"><span class="Identifier">RootEffect</span></a></pre></dt>
  362. <dd>
  363. Time effect.
  364. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/exceptions.nim#L4" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  365. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L4" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  366. </dd>
  367. </div>
  368. <div id="ValueError">
  369. <dt><pre><a href="exceptions.html#ValueError"><span class="Identifier">ValueError</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="system.html#CatchableError"><span class="Identifier">CatchableError</span></a></pre></dt>
  370. <dd>
  371. Raised for string and object conversion errors.
  372. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/exceptions.nim#L39" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  373. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L39" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  374. </dd>
  375. </div>
  376. <div id="WriteIOEffect">
  377. <dt><pre><a href="exceptions.html#WriteIOEffect"><span class="Identifier">WriteIOEffect</span></a> <span class="Other">=</span> <span class="Keyword">object</span> <span class="Keyword">of</span> <a href="exceptions.html#IOEffect"><span class="Identifier">IOEffect</span></a></pre></dt>
  378. <dd>
  379. Effect describing a write IO operation.
  380. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/system/exceptions.nim#L7" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  381. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L7" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  382. </dd>
  383. </div>
  384. </dl>
  385. </div>
  386. </div>
  387. </div>
  388. <div class="twelve-columns footer">
  389. <span class="nim-sprite"></span>
  390. <br>
  391. <small style="color: var(--hint);">Made with Nim. Generated: 2025-03-15 14:12:59 UTC</small>
  392. </div>
  393. </div>
  394. </div>
  395. <script defer data-domain="nim-lang.org" src="https://plausible.io/js/plausible.js"></script>
  396. </body>
  397. </html>