---
title: "Discussion on \"Do not throw any exceptions in property Getters (Part 2 - Exception Handling and rules for it)\" | Hashnode"
description: "Discussion on \"Do not throw any exceptions in property Getters (Part 2 - Exception Handling and rules for it)\". Some teams use a violation of this rule to control the initialization state of the object.\npublic class Person {\n    private string _name;\n\n    public string Name {\n        get {\n            if (_name == null)\n                throw new NotInitialized..."
url: "https://hashnode.com/posts/do-not-throw-any-exceptions-in-property-getters-part-2-exception-handling-and-rules-for-it/60c8419d590a5c0656565a1c"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Do not throw any exceptions in property Getters (Part 2 - Exception Handling and rules for it)](https://tomasnovacik.hashnode.dev/do-not-throw-any-exceptions-in-property-getters-part-2-exception-handling-and-rules-for-it?utm_source=hashnode&utm_medium=feed)

Some teams use a violation of this rule to control the initialization state of the object. public class Person { private string \_name; public string Name { get { if (\_name == null) throw new NotInitialized...

Jun 15, 2021 · 2 min read · tomasnovacik.hashnode.dev  
Read the article

-   [#error-handling](https://hashnode.com/tag/error-handling)
-   [#patterns](https://hashnode.com/tag/patterns)
-   [#csharp](https://hashnode.com/tag/csharp)

## Written by

[Tomáš Nováčik](https://hashnode.com/@thomasnewman)

@thomasnewman

  
[View profile](https://hashnode.com/@thomasnewman)

Software Development

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
