mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
19 lines
426 B
Plaintext
19 lines
426 B
Plaintext
/**
|
|
* @id py/examples/raise-exception
|
|
* @name Raise exception of a class
|
|
* @description Finds places where we raise AnException or one of its subclasses
|
|
* @tags throw
|
|
* raise
|
|
* exception
|
|
*/
|
|
|
|
import python
|
|
|
|
from Raise raise, ClassValue ex
|
|
where
|
|
ex.getName() = "AnException" and
|
|
(
|
|
raise.getException().pointsTo(ex.getASuperType())
|
|
)
|
|
select raise, "Don't raise instances of 'AnException'"
|