UVError.hx 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. package eval.luv;
  2. /**
  3. Error handling.
  4. @see https://aantron.github.io/luv/luv/Luv/Error
  5. **/
  6. enum abstract UVError(Int) {
  7. /** argument list too long */
  8. var UV_E2BIG = 0;
  9. /** permission denied */
  10. var UV_EACCES = 1;
  11. /** address already in use */
  12. var UV_EADDRINUSE = 2;
  13. /** address not available */
  14. var UV_EADDRNOTAVAIL = 3;
  15. /** address family not supported */
  16. var UV_EAFNOSUPPORT = 4;
  17. /** resource temporarily unavailable */
  18. var UV_EAGAIN = 5;
  19. /** address family not supported */
  20. var UV_EAI_ADDRFAMILY = 6;
  21. /** temporary failure */
  22. var UV_EAI_AGAIN = 7;
  23. /** bad ai_flags value */
  24. var UV_EAI_BADFLAGS = 8;
  25. /** invalid value for hints */
  26. var UV_EAI_BADHINTS = 9;
  27. /** request canceled */
  28. var UV_EAI_CANCELED = 10;
  29. /** permanent failure */
  30. var UV_EAI_FAIL = 11;
  31. /** ai_family not supported */
  32. var UV_EAI_FAMILY = 12;
  33. /** out of memory */
  34. var UV_EAI_MEMORY = 13;
  35. /** no address */
  36. var UV_EAI_NODATA = 14;
  37. /** unknown node or service */
  38. var UV_EAI_NONAME = 15;
  39. /** argument buffer overflow */
  40. var UV_EAI_OVERFLOW = 16;
  41. /** resolved protocol is unknown */
  42. var UV_EAI_PROTOCOL = 17;
  43. /** service not available for socket type */
  44. var UV_EAI_SERVICE = 18;
  45. /** socket type not supported */
  46. var UV_EAI_SOCKTYPE = 19;
  47. /** connection already in progress */
  48. var UV_EALREADY = 20;
  49. /** bad file descriptor */
  50. var UV_EBADF = 21;
  51. /** resource busy or locked */
  52. var UV_EBUSY = 22;
  53. /** operation canceled */
  54. var UV_ECANCELED = 23;
  55. /** invalid Unicode character */
  56. // var UV_ECHARSET = 24; // not defined in Luv ocaml library
  57. /** software caused connection abort */
  58. var UV_ECONNABORTED = 25;
  59. /** connection refused */
  60. var UV_ECONNREFUSED = 26;
  61. /** connection reset by peer */
  62. var UV_ECONNRESET = 27;
  63. /** destination address required */
  64. var UV_EDESTADDRREQ = 28;
  65. /** file already exists */
  66. var UV_EEXIST = 29;
  67. /** bad address in system call argument */
  68. var UV_EFAULT = 30;
  69. /** file too large */
  70. var UV_EFBIG = 31;
  71. /** host is unreachable */
  72. var UV_EHOSTUNREACH = 32;
  73. /** interrupted system call */
  74. var UV_EINTR = 33;
  75. /** invalid argument */
  76. var UV_EINVAL = 34;
  77. /** i/o error */
  78. var UV_EIO = 35;
  79. /** socket is already connected */
  80. var UV_EISCONN = 36;
  81. /** illegal operation on a directory */
  82. var UV_EISDIR = 37;
  83. /** too many symbolic links encountered */
  84. var UV_ELOOP = 38;
  85. /** too many open files */
  86. var UV_EMFILE = 39;
  87. /** message too long */
  88. var UV_EMSGSIZE = 40;
  89. /** name too long */
  90. var UV_ENAMETOOLONG = 41;
  91. /** network is down */
  92. var UV_ENETDOWN = 42;
  93. /** network is unreachable */
  94. var UV_ENETUNREACH = 43;
  95. /** file table overflow */
  96. var UV_ENFILE = 44;
  97. /** no buffer space available */
  98. var UV_ENOBUFS = 45;
  99. /** no such device */
  100. var UV_ENODEV = 46;
  101. /** no such file or directory */
  102. var UV_ENOENT = 47;
  103. /** not enough memory */
  104. var UV_ENOMEM = 48;
  105. /** machine is not on the network */
  106. var UV_ENONET = 49;
  107. /** protocol not available */
  108. var UV_ENOPROTOOPT = 50;
  109. /** no space left on device */
  110. var UV_ENOSPC = 51;
  111. /** function not implemented */
  112. var UV_ENOSYS = 52;
  113. /** socket is not connected */
  114. var UV_ENOTCONN = 53;
  115. /** not a directory */
  116. var UV_ENOTDIR = 54;
  117. /** directory not empty */
  118. var UV_ENOTEMPTY = 55;
  119. /** socket operation on non-socket */
  120. var UV_ENOTSOCK = 56;
  121. /** operation not supported on socket */
  122. var UV_ENOTSUP = 57;
  123. /** operation not permitted */
  124. var UV_EPERM = 58;
  125. /** broken pipe */
  126. var UV_EPIPE = 59;
  127. /** protocol error */
  128. var UV_EPROTO = 60;
  129. /** protocol not supported */
  130. var UV_EPROTONOSUPPORT = 61;
  131. /** protocol wrong type for socket */
  132. var UV_EPROTOTYPE = 62;
  133. /** result too large */
  134. var UV_ERANGE = 63;
  135. /** read-only file system */
  136. var UV_EROFS = 64;
  137. /** cannot send after transport endpoint shutdown */
  138. var UV_ESHUTDOWN = 65;
  139. /** invalid seek */
  140. var UV_ESPIPE = 66;
  141. /** no such process */
  142. var UV_ESRCH = 67;
  143. /** connection timed out */
  144. var UV_ETIMEDOUT = 68;
  145. /** text file is busy */
  146. var UV_ETXTBSY = 69;
  147. /** cross-device link not permitted */
  148. var UV_EXDEV = 70;
  149. /** unknown error */
  150. var UV_UNKNOWN = 71;
  151. /** end of file */
  152. var UV_EOF = 72;
  153. /** no such device or address */
  154. var UV_ENXIO = 73;
  155. /** too many links */
  156. var UV_EMLINK = 74;
  157. /** inappropriate ioctl for device */
  158. var UV_ENOTTY = 75;
  159. /** inappropriate file type or format */
  160. var UV_EFTYPE = 76;
  161. /** illegal byte sequence */
  162. var UV_EILSEQ = 77;
  163. /** value too large for defined data type **/
  164. var UV_EOVERFLOW = 78;
  165. /** socket type not supported**/
  166. var UV_ESOCKTNOSUPPORT = 79;
  167. /**
  168. Converts a system error code to a libuv error.
  169. **/
  170. extern static public function translateSysError(code:Int):UVError;
  171. /**
  172. Setup a callback for unhandled exceptions.
  173. @see https://aantron.github.io/luv/luv/Luv/Error#val-set_on_unhandled_exception
  174. **/
  175. extern static public function setOnUnhandledException(callback:(e:haxe.Exception)->Void):Void;
  176. /**
  177. Returns the name of the given error.
  178. **/
  179. extern public function errName():String;
  180. /**
  181. Returns the error message corresponding to the given error.
  182. **/
  183. extern public function toString():String;
  184. }