1"use strict";(self.webpackChunkplaywright_dev=self.webpackChunkplaywright_dev||[]).push([["2822"],{94187(e,r,s){s.r(r),s.d(r,{metadata:()=>t,default:()=>h,frontMatter:()=>l,contentTitle:()=>o,toc:()=>c,assets:()=>a});var t=JSON.parse('{"id":"api/class-testerror","title":"TestError","description":"Information about an error thrown during test execution.","source":"@site/docs/api/class-testerror.mdx","sourceDirName":"api","slug":"/api/class-testerror","permalink":"/docs/next/api/class-testerror","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"id":"class-testerror","title":"TestError"},"sidebar":"api","previous":{"title":"TestCase","permalink":"/docs/next/api/class-testcase"},"next":{"title":"TestResult","permalink":"/docs/next/api/class-testresult"}}'),n=s(74848),i=s(28453);s(13554),s(41647),s(83137);let l={id:"class-testerror",title:"TestError"},o,a={},c=[{value:"Properties",id:"properties",level:2},{value:"cause",id:"test-error-cause",level:3},{value:"location",id:"test-error-location",level:3},{value:"message",id:"test-error-message",level:3},{value:"snippet",id:"test-error-snippet",level:3},{value:"stack",id:"test-error-stack",level:3},{value:"value",id:"test-error-value",level:3}];function d(e){let r={a:"a",code:"code",h2:"h2",h3:"h3",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(r.p,{children:"Information about an error thrown during test execution."}),"\n",(0,n.jsx)(r.hr,{}),"\n",(0,n.jsx)(r.h2,{id:"properties",children:"Properties"}),"\n",(0,n.jsx)(r.h3,{id:"test-error-cause",children:"cause"}),"\n",(0,n.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.49"}),"\n",(0,n.jsx)("x-search",{children:"testError.cause"}),"\n",(0,n.jsxs)(r.p,{children:["Error cause. Set when there is a ",(0,n.jsx)(r.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause",children:"cause"})," for the error. Will be ",(0,n.jsx)(r.code,{children:"undefined"})," if there is no cause or if the cause is not an instance of ",(0,n.jsx)(r.a,{href:"https://nodejs.org/api/errors.html#errors_class_error",title:"Error",children:"Error"}),"."]}),"\n",(0,n.jsx)(r.p,{children:(0,n.jsx)(r.strong,{children:"Usage"})}),"\n",(0,n.jsx)(r.pre,{children:(0,n.jsx)(r.code,{className:"language-js",children:"testError.cause\n"})}),"\n",(0,n.jsx)(r.p,{children:(0,n.jsx)(r.strong,{children:"Type"})}),"\n",(0,n.jsxs)(r.ul,{children:["\n",(0,n.jsx)(r.li,{children:(0,n.jsx)(r.a,{href:"/docs/next/api/class-testerror",title:"TestError",children:"TestError"})}),"\n"]}),"\n",(0,n.jsx)(r.hr,{}),"\n",(0,n.jsx)(r.h3,{id:"test-error-location",children:"location"}),"\n",(0,n.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.30"}),"\n",(0,n.jsx)("x-search",{children:"testError.location"}),"\n",(0,n.jsx)(r.p,{children:"Error location in the source code."}),"\n",(0,n.jsx)(r.p,{children:(0,n.jsx)(r.strong,{children:"Usage"})}),"\n",(0,n.jsx)(r.pre,{children:(0,n.jsx)(r.code,{className:"language-js",children:"testError.location\n"})}),"\n",(0,n.jsx)(r.p,{children:(0,n.jsx)(r.strong,{children:"Type"})}),"\n",(0,n.jsxs)(r.ul,{children:["\n",(0,n.jsx)(r.li,{children:(0,n.jsx)(r.a,{href:"/docs/next/api/class-location",title:"Location",children:"Location"})}),"\n"]}),"\n",(0,n.jsx)(r.hr,{}),"\n",(0,n.jsx)(r.h3,{id:"test-error-message",children:"message"}),"\n",(0,n.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.10"}),"\n",(0,n.jsx)("x-search",{children:"testError.message"}),"\n",(0,n.jsxs)(r.p,{children:["Error message. Set when ",(0,n.jsx)(r.a,{href:"https://nodejs.org/api/errors.html#errors_class_error",title:"Error",children:"Error"})," (or its subclass) has been thrown."]}),"\n",(0,n.jsx)(r.p,{children:(0,n.jsx)(r.strong,{children:"Usage"})}),"\n",(0,n.jsx)(r.pre,{children:(0,n.jsx)(r.code,{className:"language-js",children:"testError.message\n"})}),"\n",(0,n.jsx)(r.p,{children:(0,n.jsx)(r.strong,{children:"Type"})}),"\n",(0,n.jsxs)(r.ul,{children:["\n",(0,n.jsx)(r.li,{children:(0,n.jsx)(r.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})}),"\n"]}),"\n",(0,n.jsx)(r.hr,{}),"\n",(0,n.jsx)(r.h3,{id:"test-error-snippet",children:"snippet"}),"\n",(0,n.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.33"}),"\n",(0,n.jsx)("x-search",{children:"testError.snippet"}),"\n",(0,n.jsx)(r.p,{children:"Source code snippet with highlighted error."}),"\n",(0,n.jsx)(r.p,{children:(0,n.jsx)(r.strong,{children:"Usage"})}),"\n",(0,n.jsx)(r.pre,{children:(0,n.jsx)(r.code,{className:"language-js",children:"testError.snippet\n"})}),"\n",(0,n.jsx)(r.p,{children:(0,n.jsx)(r.strong,{children:"Type"})}),"\n",(0,n.jsxs)(r.ul,{children:["\n",(0,n.jsx)(r.li,{children:(0,n.jsx)(r.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})}),"\n"]}),"\n",(0,n.jsx)(r.hr,{}),"\n",(0,n.jsx)(r.h3,{id:"test-error-stack",children:"stack"}),"\n",(0,n.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.10"}),"\n",(0,n.jsx)("x-search",{children:"testError.stack"}),"\n",(0,n.jsxs)(r.p,{children:["Error stack. Set when ",(0,n.jsx)(r.a,{href:"https://nodejs.org/api/errors.html#errors_class_error",title:"Error",children:"Error"})," (or its subclass) has been thrown."]}),"\n",(0,n.jsx)(r.p,{children:(0,n.jsx)(r.strong,{children:"Usage"})}),"\n",(0,n.jsx)(r.pre,{children:(0,n.jsx)(r.code,{className:"language-js",children:"testError.stack\n"})}),"\n",(0,n.jsx)(r.p,{children:(0,n.jsx)(r.strong,{children:"Type"})}),"\n",(0,n.jsxs)(r.ul,{children:["\n",(0,n.jsx)(r.li,{children:(0,n.jsx)(r.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})}),"\n"]}),"\n",(0,n.jsx)(r.hr,{}),"\n",(0,n.jsx)(r.h3,{id:"test-error-value",children:"value"}),"\n",(0,n.jsx)("font",{size:"2",style:{position:"relative",top:"-20px"},children:"Added in: v1.10"}),"\n",(0,n.jsx)("x-search",{children:"testError.value"}),"\n",(0,n.jsxs)(r.p,{children:["The value that was thrown. Set when anything except the ",(0,n.jsx)(r.a,{href:"https://nodejs.org/api/errors.html#errors_class_error",title:"Error",children:"Error"})," (or its subclass) has been thrown."]}),"\n",(0,n.jsx)(r.p,{children:(0,n.jsx)(r.strong,{children:"Usage"})}),"\n",(0,n.jsx)(r.pre,{children:(0,n.jsx)(r.code,{className:"language-js",children:"testError.value\
1n"})}),"\n",(0,n.jsx)(r.p,{children:(0,n.jsx)(r.strong,{children:"Type"})}),"\n",(0,n.jsxs)(r.ul,{children:["\n",(0,n.jsx)(r.li,{children:(0,n.jsx)(r.a,{href:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type",title:"string",children:"string"})}),"\n"]})]})}function h(e={}){let{wrapper:r}={...(0,i.R)(),...e.components};return r?(0,n.jsx)(r,{...e,children:(0,n.jsx)(d,{...e})}):d(e)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.