{"record":{"id":"1084893f8fb26135","repo":"OrchardCMS/OrchardCore","slug":"msg-108489","errorCode":null,"errorMessage":"msg","messagePattern":"msg","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Vendor/jquery-3.5.1/jquery.js","lineNumber":334,"sourceCode":"\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n\njQuery.extend( {\n\n\t// Unique for each copy of jQuery on the page\n\texpando: \"jQuery\" + ( version + Math.random() ).replace( /\\D/g, \"\" ),\n\n\t// Assume jQuery is ready without the ready module\n\tisReady: true,\n\n\terror: function( msg ) {\n\t\tthrow new Error( msg );\n\t},\n\n\tnoop: function() {},\n\n\tisPlainObject: function( obj ) {\n\t\tvar proto, Ctor;\n\n\t\t// Detect obvious negatives\n\t\t// Use toString instead of jQuery.type to catch host objects\n\t\tif ( !obj || toString.call( obj ) !== \"[object Object]\" ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tproto = getProto( obj );\n\n\t\t// Objects with no prototype (e.g., `Object.create( null )`) are plain\n\t\tif ( !proto ) {\n\t\t\treturn true;","sourceCodeStart":316,"sourceCodeEnd":352,"githubUrl":"https://github.com/OrchardCMS/OrchardCore/blob/4306c0717fe573f6fca1b4955909ddab6a192807/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Vendor/jquery-3.5.1/jquery.js#L316-L352","documentation":"jQuery.error is jQuery's generic error-raising helper: it simply throws a new Error with the supplied message. It is the internal mechanism behind many jQuery failures (e.g. via $.fn.html template parsing or Deferred exception propagation), so this throw site means some jQuery code path called $.error('...') with a specific message.","triggerScenarios":"Any internal jQuery code path that detects a bad input and calls $.error(message) — e.g. malformed template/HTML passed to html(), unsupported selector cases routed to error(), or invalid arguments to methods that delegate their failure reporting to jQuery.error.","commonSituations":"Reading a stack trace where the top frame is jQuery.error and the real message is in the thrown Error's message property; the actual offending call is the second frame in the stack, not line 334 itself.","solutions":["Read the full Error message and stack below this frame to find the jQuery API that called $.error; fix the arguments passed there.","Wrap the offending jQuery call in try/catch to intercept the thrown Error and log/report it.","Check jQuery upgrade notes if a previously-working call now throws; behavior can change between 3.5.1 and 3.6.0."],"exampleFix":"// before\n$('#el').html(someUntrustedString); // may surface via $.error\n// after\ntry {\n  $('#el').html(someUntrustedString);\n} catch (e) {\n  console.error('jQuery call failed:', e.message);\n}","handlingStrategy":"try-catch","validationCode":"// Validate inputs to jQuery APIs before calling them:\nif (typeof selectorOrHtml !== 'string' || !selectorOrHtml.trim()) {\n  throw new Error('Refusing to call jQuery with empty/invalid input');\n}","typeGuard":"function isNonEmptyString(v) { return typeof v === 'string' && v.length > 0; }","tryCatchPattern":"try { $(input).doSomething(); } catch (e) { if (e instanceof Error && e.message) { report('jQuery $.error thrown: ' + e.message); } else { throw e; } }","preventionTips":["Always read e.message plus the stack below the $.error frame to find the real call site.","Sanitize any untrusted string before handing it to DOM/HTML jQuery APIs.","Pin and review jQuery version changes when upgrading.","Log the full Error object, never just the frame that threw."],"tags":["jquery","error-helper","runtime"],"backgroundTag":"invalid-argument-value","analyzedSha":"4306c0717fe573f6fca1b4955909ddab6a192807","analyzedAt":"2026-09-13T17:41:05.024Z","contentChangedAt":"2026-09-13T17:41:05.024Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}