oserrors.html 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  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>std/oserrors</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">std/oserrors</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="#OSErrorCode" title="OSErrorCode = distinct int32">OSErrorCode</a></li>
  54. </ul>
  55. </details>
  56. </li>
  57. <li>
  58. <details open>
  59. <summary><a class="reference reference-toplevel" href="#12" id="62">Procs</a></summary>
  60. <ul class="simple simple-toc-section">
  61. <ul class="simple nested-toc-section">$
  62. <li><a class="reference" href="#%24%2COSErrorCode" title="`$`(err: OSErrorCode): string">`$`(err: OSErrorCode): string</a></li>
  63. </ul>
  64. <ul class="simple nested-toc-section">==
  65. <li><a class="reference" href="#%3D%3D%2COSErrorCode%2COSErrorCode" title="`==`(err1, err2: OSErrorCode): bool">`==`(err1, err2: OSErrorCode): bool</a></li>
  66. </ul>
  67. <ul class="simple nested-toc-section">newOSError
  68. <li><a class="reference" href="#newOSError%2COSErrorCode%2Cstring" title="newOSError(errorCode: OSErrorCode; additionalInfo = &quot;&quot;): owned(ref OSError)">newOSError(errorCode: OSErrorCode; additionalInfo = &quot;&quot;): owned(ref OSError)</a></li>
  69. </ul>
  70. <ul class="simple nested-toc-section">osErrorMsg
  71. <li><a class="reference" href="#osErrorMsg%2COSErrorCode" title="osErrorMsg(errorCode: OSErrorCode): string">osErrorMsg(errorCode: OSErrorCode): string</a></li>
  72. </ul>
  73. <ul class="simple nested-toc-section">osLastError
  74. <li><a class="reference" href="#osLastError" title="osLastError(): OSErrorCode">osLastError(): OSErrorCode</a></li>
  75. </ul>
  76. <ul class="simple nested-toc-section">raiseOSError
  77. <li><a class="reference" href="#raiseOSError%2COSErrorCode%2Cstring" title="raiseOSError(errorCode: OSErrorCode; additionalInfo = &quot;&quot;)">raiseOSError(errorCode: OSErrorCode; additionalInfo = &quot;&quot;)</a></li>
  78. </ul>
  79. </ul>
  80. </details>
  81. </li>
  82. </ul>
  83. </div>
  84. <div class="nine columns" id="content">
  85. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/oserrors.nim#L1" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  86. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/oserrors.nim#L1" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  87. <div id="tocRoot"></div>
  88. <p class="module-desc">The <tt class="docutils literal"><span class="pre"><span class="Identifier">std</span><span class="Operator">/</span><span class="Identifier">oserrors</span></span></tt> module implements OS error reporting.</p>
  89. <div class="section" id="7">
  90. <h1><a class="toc-backref" href="#7">Types</a></h1>
  91. <dl class="item">
  92. <div id="OSErrorCode">
  93. <dt><pre><a href="oserrors.html#OSErrorCode"><span class="Identifier">OSErrorCode</span></a> <span class="Other">=</span> <span class="Keyword">distinct</span> <a href="system.html#int32"><span class="Identifier">int32</span></a></pre></dt>
  94. <dd>
  95. Specifies an OS Error Code.
  96. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/oserrors.nim#L14" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  97. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/oserrors.nim#L14" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  98. </dd>
  99. </div>
  100. </dl>
  101. </div>
  102. <div class="section" id="12">
  103. <h1><a class="toc-backref" href="#12">Procs</a></h1>
  104. <dl class="item">
  105. <div id="$-procs-all">
  106. <div id="$,OSErrorCode">
  107. <dt><pre><span class="Keyword">proc</span> <a href="#%24%2COSErrorCode"><span class="Identifier">`$`</span></a><span class="Other">(</span><span class="Identifier">err</span><span class="Other">:</span> <a href="oserrors.html#OSErrorCode"><span class="Identifier">OSErrorCode</span></a><span class="Other">)</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a> {.<span class="Identifier">borrow</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  108. <dd>
  109. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/oserrors.nim#L28" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  110. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/oserrors.nim#L28" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  111. </dd>
  112. </div>
  113. </div>
  114. <div id="==-procs-all">
  115. <div id="==,OSErrorCode,OSErrorCode">
  116. <dt><pre><span class="Keyword">proc</span> <a href="#%3D%3D%2COSErrorCode%2COSErrorCode"><span class="Identifier">`==`</span></a><span class="Other">(</span><span class="Identifier">err1</span><span class="Other">,</span> <span class="Identifier">err2</span><span class="Other">:</span> <a href="oserrors.html#OSErrorCode"><span class="Identifier">OSErrorCode</span></a><span class="Other">)</span><span class="Other">:</span> <a href="system.html#bool"><span class="Identifier">bool</span></a> {.<span class="Identifier">borrow</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
  117. <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  118. <dd>
  119. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/oserrors.nim#L27" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  120. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/oserrors.nim#L27" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  121. </dd>
  122. </div>
  123. </div>
  124. <div id="newOSError-procs-all">
  125. <div id="newOSError,OSErrorCode,string">
  126. <dt><pre><span class="Keyword">proc</span> <a href="#newOSError%2COSErrorCode%2Cstring"><span class="Identifier">newOSError</span></a><span class="Other">(</span><span class="Identifier">errorCode</span><span class="Other">:</span> <a href="oserrors.html#OSErrorCode"><span class="Identifier">OSErrorCode</span></a><span class="Other">;</span> <span class="Identifier">additionalInfo</span> <span class="Other">=</span> <span class="StringLit">&quot;&quot;</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">owned</span><span class="Other">(</span><span class="Keyword">ref</span> <a href="exceptions.html#OSError"><span class="Identifier">OSError</span></a><span class="Other">)</span> {.
  127. <span class="Identifier">noinline</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  128. <dd>
  129. <p>Creates a new <a class="reference external" href="system.html#OSError">OSError exception</a>.</p>
  130. <p>The <tt class="docutils literal"><span class="pre"><span class="Identifier">errorCode</span></span></tt> will determine the message, <a class="reference internal nimdoc" title="proc osErrorMsg(errorCode: OSErrorCode): string" href="#osErrorMsg,OSErrorCode">osErrorMsg proc</a> will be used to get this message.</p>
  131. <p>The error code can be retrieved using the <a class="reference internal nimdoc" title="proc osLastError(): OSErrorCode" href="#osLastError">osLastError proc</a>.</p>
  132. <p>If the error code is <tt class="docutils literal"><span class="pre"><span class="DecNumber">0</span></span></tt> or an error message could not be retrieved, the message <tt class="docutils literal"><span class="pre"><span class="Identifier">unknown</span> <span class="Identifier">OS</span> <span class="Identifier">error</span></span></tt> will be used.</p>
  133. <p>See also:</p>
  134. <ul class="simple"><li><a class="reference internal nimdoc" title="proc osErrorMsg(errorCode: OSErrorCode): string" href="#osErrorMsg,OSErrorCode">osErrorMsg proc</a></li>
  135. <li><a class="reference internal nimdoc" title="proc osLastError(): OSErrorCode" href="#osLastError">osLastError proc</a></li>
  136. </ul>
  137. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/oserrors.nim#L61" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  138. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/oserrors.nim#L61" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  139. </dd>
  140. </div>
  141. </div>
  142. <div id="osErrorMsg-procs-all">
  143. <div id="osErrorMsg,OSErrorCode">
  144. <dt><pre><span class="Keyword">proc</span> <a href="#osErrorMsg%2COSErrorCode"><span class="Identifier">osErrorMsg</span></a><span class="Other">(</span><span class="Identifier">errorCode</span><span class="Other">:</span> <a href="oserrors.html#OSErrorCode"><span class="Identifier">OSErrorCode</span></a><span class="Other">)</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
  145. <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  146. <dd>
  147. <p>Converts an OS error code into a human readable string.</p>
  148. <p>The error code can be retrieved using the <a class="reference internal nimdoc" title="proc osLastError(): OSErrorCode" href="#osLastError">osLastError proc</a>.</p>
  149. <p>If conversion fails, or <tt class="docutils literal"><span class="pre"><span class="Identifier">errorCode</span></span></tt> is <tt class="docutils literal"><span class="pre"><span class="DecNumber">0</span></span></tt> then <tt class="docutils literal"><span class="pre"><span class="StringLit">&quot;&quot;</span></span></tt> will be returned.</p>
  150. <p>See also:</p>
  151. <ul class="simple"><li><a class="reference internal nimdoc" title="proc raiseOSError(errorCode: OSErrorCode; additionalInfo = &quot;&quot;)" href="#raiseOSError,OSErrorCode,string">raiseOSError proc</a></li>
  152. <li><a class="reference internal nimdoc" title="proc osLastError(): OSErrorCode" href="#osLastError">osLastError proc</a></li>
  153. </ul>
  154. <p><strong class="examples_text">Example:</strong></p>
  155. <pre class="listing"><span class="Keyword">when</span> <span class="Identifier">defined</span><span class="Punctuation">(</span><span class="Identifier">linux</span><span class="Punctuation">)</span><span class="Punctuation">:</span>
  156. <span class="Identifier">assert</span> <span class="Identifier">osErrorMsg</span><span class="Punctuation">(</span><span class="Identifier">OSErrorCode</span><span class="Punctuation">(</span><span class="DecNumber">0</span><span class="Punctuation">)</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="StringLit">&quot;&quot;</span>
  157. <span class="Identifier">assert</span> <span class="Identifier">osErrorMsg</span><span class="Punctuation">(</span><span class="Identifier">OSErrorCode</span><span class="Punctuation">(</span><span class="DecNumber">1</span><span class="Punctuation">)</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="StringLit">&quot;Operation not permitted&quot;</span>
  158. <span class="Identifier">assert</span> <span class="Identifier">osErrorMsg</span><span class="Punctuation">(</span><span class="Identifier">OSErrorCode</span><span class="Punctuation">(</span><span class="DecNumber">2</span><span class="Punctuation">)</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="StringLit">&quot;No such file or directory&quot;</span></pre>
  159. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/oserrors.nim#L30" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  160. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/oserrors.nim#L30" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  161. </dd>
  162. </div>
  163. </div>
  164. <div id="osLastError-procs-all">
  165. <div id="osLastError">
  166. <dt><pre><span class="Keyword">proc</span> <a href="#osLastError"><span class="Identifier">osLastError</span></a><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <a href="oserrors.html#OSErrorCode"><span class="Identifier">OSErrorCode</span></a> {.<span class="Identifier">sideEffect</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  167. <dd>
  168. <p>Retrieves the last operating system error code.</p>
  169. <p>This procedure is useful in the event when an OS call fails. In that case this procedure will return the error code describing the reason why the OS call failed. The <tt class="docutils literal"><span class="pre"><span class="Identifier">OSErrorMsg</span></span></tt> procedure can then be used to convert this code into a string.</p>
  170. <div class="admonition admonition-warning"><span class="admonition-warning-text"><b>Warning:</b></span>
  171. The behaviour of this procedure varies between Windows and POSIX systems. On Windows some OS calls can reset the error code to <tt class="docutils literal"><span class="pre"><span class="DecNumber">0</span></span></tt> causing this procedure to return <tt class="docutils literal"><span class="pre"><span class="DecNumber">0</span></span></tt>. It is therefore advised to call this procedure immediately after an OS call fails. On POSIX systems this is not a problem.</div>
  172. <p>See also:</p>
  173. <ul class="simple"><li><a class="reference internal nimdoc" title="proc osErrorMsg(errorCode: OSErrorCode): string" href="#osErrorMsg,OSErrorCode">osErrorMsg proc</a></li>
  174. <li><a class="reference internal nimdoc" title="proc raiseOSError(errorCode: OSErrorCode; additionalInfo = &quot;&quot;)" href="#raiseOSError,OSErrorCode,string">raiseOSError proc</a></li>
  175. </ul>
  176. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/oserrors.nim#L95" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  177. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/oserrors.nim#L95" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  178. </dd>
  179. </div>
  180. </div>
  181. <div id="raiseOSError-procs-all">
  182. <div id="raiseOSError,OSErrorCode,string">
  183. <dt><pre><span class="Keyword">proc</span> <a href="#raiseOSError%2COSErrorCode%2Cstring"><span class="Identifier">raiseOSError</span></a><span class="Other">(</span><span class="Identifier">errorCode</span><span class="Other">:</span> <a href="oserrors.html#OSErrorCode"><span class="Identifier">OSErrorCode</span></a><span class="Other">;</span> <span class="Identifier">additionalInfo</span> <span class="Other">=</span> <span class="StringLit">&quot;&quot;</span><span class="Other">)</span> {.<span class="Identifier">noinline</span><span class="Other">,</span>
  184. <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">OSError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
  185. <dd>
  186. <p>Raises an <a class="reference external" href="system.html#OSError">OSError exception</a>.</p>
  187. <p>Read the description of the <a class="reference internal nimdoc" title="proc newOSError(errorCode: OSErrorCode; additionalInfo = &quot;&quot;): owned(ref OSError)" href="#newOSError,OSErrorCode,string">newOSError proc</a> to learn how the exception object is created.</p>
  188. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/oserrors.nim#L87" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  189. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/oserrors.nim#L87" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  190. </dd>
  191. </div>
  192. </div>
  193. </dl>
  194. </div>
  195. </div>
  196. </div>
  197. <div class="twelve-columns footer">
  198. <span class="nim-sprite"></span>
  199. <br>
  200. <small style="color: var(--hint);">Made with Nim. Generated: 2024-12-25 08:36:34 UTC</small>
  201. </div>
  202. </div>
  203. </div>
  204. <script defer data-domain="nim-lang.org" src="https://plausible.io/js/plausible.js"></script>
  205. </body>
  206. </html>