[{"data":1,"prerenderedAt":214},["ShallowReactive",2],{"term-e\u002Ferror":3,"related-e\u002Ferror":197},{"id":4,"title":5,"acronym":6,"body":7,"category":178,"description":179,"difficulty":180,"extension":181,"letter":182,"meta":183,"navigation":54,"path":184,"related":185,"seo":191,"sitemap":192,"stem":195,"subcategory":6,"__hash__":196},"terms\u002Fterms\u002Fe\u002Ferror.md","Error",null,{"type":8,"value":9,"toc":172},"minimark",[10,15,19,23,26,30,161,165,168],[11,12,14],"h2",{"id":13},"eli5-the-vibe-check","ELI5 — The Vibe Check",[16,17,18],"p",{},"An error is when your program says 'I cannot do that' and either stops or complains loudly. It is the computer's way of telling you something went wrong. Errors come in flavors: syntax errors (you misspelled something), runtime errors (it broke while running), and logic errors (it ran but did the wrong thing).",[11,20,22],{"id":21},"real-talk","Real Talk",[16,24,25],{},"An error is any condition that causes a program to behave unexpectedly or halt. In most languages, errors are objects\u002Fvalues with a type, message, and stack trace. Errors can be caught and handled (try\u002Fcatch) or left to propagate up the call stack. Unhandled errors in Node.js terminate the process; in browsers they log to the console.",[11,27,29],{"id":28},"show-me-the-code","Show Me The Code",[31,32,37],"pre",{"className":33,"code":34,"language":35,"meta":36,"style":36},"language-javascript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u002F\u002F Different types of errors:\n\n\u002F\u002F SyntaxError — caught before running:\n\u002F\u002F const x = {  \u002F\u002F Missing closing bracket\n\n\u002F\u002F TypeError — at runtime:\nconst user = null;\nuser.name; \u002F\u002F TypeError: Cannot read properties of null\n\n\u002F\u002F Custom Error:\nthrow new Error(\"User not found\");\n","javascript","",[38,39,40,49,56,62,71,76,82,100,118,123,129],"code",{"__ignoreMap":36},[41,42,45],"span",{"class":43,"line":44},"line",1,[41,46,48],{"class":47},"sHwdD","\u002F\u002F Different types of errors:\n",[41,50,52],{"class":43,"line":51},2,[41,53,55],{"emptyLinePlaceholder":54},true,"\n",[41,57,59],{"class":43,"line":58},3,[41,60,61],{"class":47},"\u002F\u002F SyntaxError — caught before running:\n",[41,63,65,68],{"class":43,"line":64},4,[41,66,67],{"class":47},"\u002F\u002F const x = {",[41,69,70],{"class":47},"  \u002F\u002F Missing closing bracket\n",[41,72,74],{"class":43,"line":73},5,[41,75,55],{"emptyLinePlaceholder":54},[41,77,79],{"class":43,"line":78},6,[41,80,81],{"class":47},"\u002F\u002F TypeError — at runtime:\n",[41,83,85,89,93,97],{"class":43,"line":84},7,[41,86,88],{"class":87},"spNyl","const",[41,90,92],{"class":91},"sTEyZ"," user ",[41,94,96],{"class":95},"sMK4o","=",[41,98,99],{"class":95}," null;\n",[41,101,103,106,109,112,115],{"class":43,"line":102},8,[41,104,105],{"class":91},"user",[41,107,108],{"class":95},".",[41,110,111],{"class":91},"name",[41,113,114],{"class":95},";",[41,116,117],{"class":47}," \u002F\u002F TypeError: Cannot read properties of null\n",[41,119,121],{"class":43,"line":120},9,[41,122,55],{"emptyLinePlaceholder":54},[41,124,126],{"class":43,"line":125},10,[41,127,128],{"class":47},"\u002F\u002F Custom Error:\n",[41,130,132,136,139,143,146,149,153,155,158],{"class":43,"line":131},11,[41,133,135],{"class":134},"s7zQu","throw",[41,137,138],{"class":95}," new",[41,140,142],{"class":141},"s2Zo4"," Error",[41,144,145],{"class":91},"(",[41,147,148],{"class":95},"\"",[41,150,152],{"class":151},"sfazB","User not found",[41,154,148],{"class":95},[41,156,157],{"class":91},")",[41,159,160],{"class":95},";\n",[11,162,164],{"id":163},"when-youll-hear-this","When You'll Hear This",[16,166,167],{},"\"What error are you getting?\" \u002F \"Always read the full error message — it tells you what and where.\"",[169,170,171],"style",{},"html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":36,"searchDepth":51,"depth":51,"links":173},[174,175,176,177],{"id":13,"depth":51,"text":14},{"id":21,"depth":51,"text":22},{"id":28,"depth":51,"text":29},{"id":163,"depth":51,"text":164},"general","An error is when your program says 'I cannot do that' and either stops or complains loudly. It is the computer's way of telling you something went wrong.","beginner","md","e",{},"\u002Fterms\u002Fe\u002Ferror",[186,187,188,189,190],"Exception","Bug","Syntax Error","Runtime Error","Try\u002FCatch",{"title":5,"description":179},{"changefreq":193,"priority":194},"weekly",0.7,"terms\u002Fe\u002Ferror","ScSZL_Cdr8maTp09lzxSjwj-QFSfi5ESK14UfTVBhFw",[198,201,205,208,211],{"title":187,"path":199,"acronym":6,"category":178,"difficulty":180,"description":200},"\u002Fterms\u002Fb\u002Fbug","A bug is anything in your code that makes it behave wrong.",{"title":186,"path":202,"acronym":6,"category":178,"difficulty":203,"description":204},"\u002Fterms\u002Fe\u002Fexception","intermediate","An exception is a special kind of error that 'throws' itself up through your code like a hot potato, looking for someone to catch it.",{"title":189,"path":206,"acronym":6,"category":178,"difficulty":180,"description":207},"\u002Fterms\u002Fr\u002Fruntime-error","A runtime error is one that only shows up when your program is actually running, not before.",{"title":188,"path":209,"acronym":6,"category":178,"difficulty":180,"description":210},"\u002Fterms\u002Fs\u002Fsyntax-error","A syntax error is when you write code that the computer cannot even understand — like handing someone a sentence with no verbs.",{"title":190,"path":212,"acronym":6,"category":178,"difficulty":180,"description":213},"\u002Fterms\u002Ft\u002Ftry-catch","Try\u002Fcatch is your safety net. You put risky code in the 'try' box, and if it blows up, the 'catch' box catches the explosion and handles it gracefully inst...",1776518277549]