Stop build on first error

The vsCommandEvent also contains this feature and you should use this documentation, however with next notice:

Instead of "Errors-Build" event, you should configure the Output window tab:

variant Guid Item Condition Type
№ 1 {1BD8A850-02D1-11d1-BEE7-00A0C913D1F8}   \s+error\s+([^:]+): Regexp
№ 2   Build \s+error\s+([^:]+): Regexp

if you need control of errors and warnings, use for example:

Condition Type
\s+(?:error|warning)\s+([^:]+): Regexp

How to get this error/warning

If also need getting of this data, you should use SBE-Scripts engine, for example:

#[( #[OWP out.Warnings.Count] > 0 ){
    ... #[OWP out.Warnings.Codes]
}]

...
#[OWP out.Errors]

see OWPComponent for details.

References