Every error and warning carries a code. The command line prints it with the source line it points at, the language server sends it to the editor, and Python raises it inside qirc.CompileError. qirc explain <code> prints a longer explanation of any of them, and a mistyped option, emit kind or gate name gets a suggestion of the nearest valid one.
the Base Profile forbids reading a measurement result
QIR0302
a qubit outside the declared register
QIR0303
a gate uses the same qubit twice
QIR0304
a gate has the wrong number of parameters
QIR0305
a gate has the wrong number of targets
QIR0306
a result outside the declared results
QIR0307
a branch to a block that does not exist
QIR0308
a result read before it is measured
The profile comes from the qir_profiles attribute on the entry point, and the declared counts from required_num_qubits and required_num_results. A Base Profile program that needs branching can declare adaptive_profile instead.