Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Hata Yönetimi

BERK'te güvenli hata yönetimi.

Try-Catch Blokları

Hata yakalama:

deneme {
    riski_işlem()
} yakala e {
    yazdır("Hata: ", e)
}

Hata Türleri

Result ve Option tipleri:

tür Sonuç<T, E> = enum {
    Tamam(T),
    Hata(E)
}

Hata Yönetim Stratejileri

  1. Result Tipi: Fonksiyon dönüşü
  2. Try-Catch: Exception handling
  3. Option: Null yerine
  4. Panic: Kurtarılamaz hatalar