---
uid: BenchmarkDotNet.Samples.IntroStopOnFirstError
---

## Sample: IntroStopOnFirstError

BenchmarkDotNet can be configured to stop on first error. You just have to add `StopOnFirstError` attribute to your class or use `--stopOnFirstError` command line argument.

### Source code

[!code-csharp[IntroStopOnFirstError.cs](../../../samples/BenchmarkDotNet.Samples/IntroStopOnFirstError.cs)]

### Links

* @docs.configs
* @docs.console-args
* The permanent link to this sample: @BenchmarkDotNet.Samples.IntroStopOnFirstError

---