Please don't throw exceptions, it would make the UX of your plugin in the IDE terrible as IDE won't be able to properly recover from your exception.
Instead you need to create checkers FIR checkers using
FirAdditionalCheckersExtension, which have a proper API for reporting warnings and errors.
If you want to report an error from the IR part of the plugin, you need to use
IrPluginContext.diagnosticReporter
for that.