{"id":6340,"date":"2022-12-20T18:58:11","date_gmt":"2022-12-20T21:58:11","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/error-mann\/"},"modified":"2022-12-20T18:58:11","modified_gmt":"2022-12-20T21:58:11","slug":"error-mann","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/error-mann\/","title":{"rendered":"error (mann)"},"content":{"rendered":"<h1 align=\"center\">error<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#EXAMPLE\">EXAMPLE<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#KEYWORDS\">KEYWORDS<\/a> <\/p>\n<hr>\n<p>______________________________________________________________________________<\/p>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">error \u2212 Generate an error<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>error<\/b> <i>message<\/i> ?<i>info<\/i>? ?<i>code<\/i>? ______________________________________________________________________________<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Returns a <b>TCL_ERROR<\/b> code, which causes command interpretation to be unwound. <i>Message<\/i> is a string that is returned to the application to indicate what went wrong.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <b>\u2212errorinfo<\/b> return option of an interpreter is used to accumulate a stack trace of what was in progress when an error occurred; as nested commands unwind, the Tcl interpreter adds information to the <b>\u2212errorinfo<\/b> return option. If the <i>info<\/i> argument is present, it is used to initialize the <b>\u2212errorinfo<\/b> return options and the first increment of unwind information will not be added by the Tcl interpreter. In other words, the command containing the <b>error<\/b> command will not appear in the stack trace; in its place will be <i>info<\/i>. Historically, this feature had been most useful in conjunction with the <b>catch<\/b> command: if a caught error cannot be handled successfully, <i>info<\/i> can be used to return a stack trace reflecting the original point of occurrence of the error:<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">catch {&#8230;} errMsg <br \/> set savedInfo $::errorInfo <br \/> &#8230; <b><br \/> error<\/b> $errMsg $savedInfo<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">When working with Tcl 8.5 or later, the following code should be used instead:<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">catch {&#8230;} errMsg options <br \/> &#8230; <br \/> return -options $options $errMsg<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If the <i>code<\/i> argument is present, then its value is stored in the <b>\u2212errorcode<\/b> return option. The <b>\u2212errorcode<\/b> return option is intended to hold a machine-readable description of the error in cases where such information is available; see the <b>return<\/b> manual page for information on the proper format for this option\u2019s value.<\/p>\n<h2>EXAMPLE <a name=\"EXAMPLE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Generate an error if a basic mathematical operation fails:<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">if {1+2 != 3} { <b><br \/> error<\/b> &#8220;something is very wrong with addition&#8221; <br \/> }<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">catch(n), return(n)<\/p>\n<h2>KEYWORDS <a name=\"KEYWORDS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">error, exception<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  error \u2212 Generate an error <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3783,1],"tags":[2933,2635],"class_list":["post-6340","post","type-post","status-publish","format-standard","hentry","category-n-comandos-tcl-tk","category-sin-categoria","tag-error","tag-mann"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/6340","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=6340"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/6340\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=6340"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=6340"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=6340"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}