Files
codeql/csharp/ql/examples/snippets/throw_exception.ql
2023-11-10 08:46:15 +01:00

15 lines
363 B
Plaintext

/**
* @id cs/examples/throw-exception
* @name Throw exception of given type
* @description Finds places where we throw 'System.IO.IOException' or one of its subtypes.
* @tags throw
* exception
*/
import csharp
from ThrowStmt throw
where
throw.getThrownExceptionType().getBaseClass*().hasFullyQualifiedName("System.IO", "IOException")
select throw