---
title: "Comment by Roman Izosimov on \"Unit Tests Done Right\" | Hashnode"
description: "When you check an exception message do you think it might be worth using a constant template for the error message to don&#39;t break a test just because you ha"
url: "https://hashnode.com/posts/unit-tests-done-right/626ef1d7a2d355d4df441063/comment/62bb2b657131dfe7a8b59651"
---

[Discussion](https://hashnode.com/posts/unit-tests-done-right/626ef1d7a2d355d4df441063)

Comment [Unit Tests Done Right](https://hashnode.com/posts/unit-tests-done-right/626ef1d7a2d355d4df441063)

[Roman Izosimov](https://hashnode.com/@RomanIzosimov)

[Jun 28, 2022](https://hashnode.com/posts/unit-tests-done-right/626ef1d7a2d355d4df441063/comment/62bb2b657131dfe7a8b59651)

When you check an exception message do you think it might be worth using a constant template for the error message to don't break a test just because you have changed the message, or better to have the test broken on each change of the message and amend it accordingly?

[Aleksei Zagoskin](https://hashnode.com/@azagoskin)

[Jul 8, 2022](https://hashnode.com/posts/unit-tests-done-right/626ef1d7a2d355d4df441063/comment/62bb2b657131dfe7a8b59651#reply-62c86c3655f37390f97ca3cd)

Good call. Sometimes I don't check the exception message at all, just exception type and properties (for custom exceptions).
