Skip to main content

find_throw_sites

Find every place an exception type is thrown across the solution — throw new T(...), throw expr; and bare throw; rethrows (whose type comes from the enclosing catch). The exception type may live in source or in metadata, so System.ArgumentNullException works as well as your own MyApp.DomainException. Set includeDerived to also match subclasses of the requested type. Every throw in the file is reported, including throws inside lambdas and local functions, attributed to the member that contains them — use get_exception_flow instead when the question is which exceptions escape a specific method. Returns an envelope with items, totalCount, truncated, limit and a byType / byProject summary, sorted by file, line, column.

Parameters

ParameterTypeRequiredDescription
exceptionTypestringException type to search for (e.g. System.InvalidOperationException or MyApp.DomainException).
includeDerivedboolAlso match types deriving from the requested one. Default false (exact type only).
limitint?Maximum number of items to return (default: 500).