# Improper Handling of Exceptional Conditions (CWE-755) The product does not handle or incorrectly handles an exceptional condition. **Stack:** Go - Prevalence: मध्यम 3 भाषाएँ कवर की गईं - Impact: उच्च 1 उच्च गंभीरता वाले नियम - Prevention: प्रलेखित 4 फिक्स उदाहरण **OWASP:** Insecure Design (A04:2021-Insecure Design) - #4 ## Description When exceptional conditions are not properly handled, the product may enter an undefined state, crash, or expose sensitive information. This can lead to denial of service, information disclosure, or unexpected behavior. ## Prevention 1 Shoulder डिटेक्शन नियमों पर आधारित Improper Handling of Exceptional Conditions के लिए रोकथाम रणनीतियाँ। ### Go Always check error return values before using other results ## Consequences - DoS - एप्लिकेशन डेटा पढ़ना - अनधिकृत कोड निष्पादित करना ## Mitigations - सभी संभावित असाधारण स्थितियों का अनुमान लगाएँ और उन्हें उचित ढंग से संभालें - try-catch ब्लॉकों और उचित त्रुटि प्रबंधन तंत्रों का उपयोग करें - अपवाद होने पर सुरक्षित रूप से विफल हों ## Detection - Total rules: 4 - Languages: go, javascript, typescript, python ## Rules by Language ### Go (1 rules) - **Incomplete Error Handling** [MEDIUM]: Function returns error but caller does not check err != nil. - Remediation: Check error return values before using other returned values. ```go result, err := process() if err != nil { return err } // Now safe to use result ``` Learn more: https://shoulder.dev/learn/go/cwe-755/incomplete-error-handling