{"record":{"id":"f2f79be9ca9080bd","repo":"HandyOrg/HandyControl","slug":"message","errorCode":null,"errorMessage":"message","messagePattern":"message","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"src/Shared/Microsoft.Windows.Shell/Standard/Verify.cs","lineNumber":125,"sourceCode":"    }\n\n    [SuppressMessage(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n    [DebuggerStepThrough]\n    public static void IsTrue(bool statement, string name)\n    {\n        if (!statement)\n        {\n            throw new ArgumentException(\"\", name);\n        }\n    }\n\n    [DebuggerStepThrough]\n    [SuppressMessage(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n    public static void IsTrue(bool statement, string name, string message)\n    {\n        if (!statement)\n        {\n            throw new ArgumentException(message, name);\n        }\n    }\n\n    [DebuggerStepThrough]\n    [SuppressMessage(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n    public static void AreEqual<T>(T expected, T actual, string parameterName, string message)\n    {\n        if (expected == null)\n        {\n            if (actual != null && !actual.Equals(expected))\n            {\n                throw new ArgumentException(message, parameterName);\n            }\n        }\n        else if (!expected.Equals(actual))\n        {\n            throw new ArgumentException(message, parameterName);\n        }","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/HandyOrg/HandyControl/blob/2c0875ebd67326e0c67282967e3e809c69282fee/src/Shared/Microsoft.Windows.Shell/Standard/Verify.cs#L107-L143","documentation":"Verify.IsTrue(statement, name, message) throws ArgumentException(message, name) when the boolean condition is false, surfacing the caller-provided message. It is the standard precondition assertion of this Verify helper class.","triggerScenarios":"Calling an API whose implementation asserts a condition via Verify.IsTrue(cond, paramName, message) and the condition evaluates false (e.g. argument out of an allowed set, inconsistent parameter combination).","commonSituations":"Passing values that violate documented preconditions, refactoring that changed which values are legal, unit-test expectations diverging from library invariants.","solutions":["Read the exception message and ParamName to see which condition failed; correct the argument.","Re-check the API documentation for the asserted precondition.","Validate inputs at your boundary before calling."],"exampleFix":"// before\nVerify.IsTrue(value > 0, nameof(value), \"value must be positive\"); // throws when value <= 0\n// after\nif (value <= 0) value = Math.Max(1, value);\nVerify.IsTrue(value > 0, nameof(value), \"value must be positive\");","handlingStrategy":"validation","validationCode":"if (!condition)\n    throw new ArgumentException($\"Precondition failed: {message}\", nameof(value));","typeGuard":null,"tryCatchPattern":"try { api.Call(value); }\ncatch (ArgumentException ex) when (ex.ParamName == nameof(value)) { /* read ex.Message for the failed condition */ }","preventionTips":["Read the assertion message — it states the exact violated condition.","Validate inputs at your boundary before calling library code.","Keep argument-constraint knowledge in one validation layer."],"tags":["argument-validation","assertion","dotnet"],"backgroundTag":"invalid-argument-value","analyzedSha":"2c0875ebd67326e0c67282967e3e809c69282fee","analyzedAt":"2026-09-14T14:45:29.754Z","contentChangedAt":"2026-09-14T14:45:29.754Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}