Skip to content

Commit 5226aee

Browse files
committed
Hata Yakalama çevirildi
1 parent ccca9ec commit 5226aee

File tree

1 file changed

+21
-25
lines changed

1 file changed

+21
-25
lines changed

README.md

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1796,41 +1796,37 @@ async function temizKodMakalesiniAl() {
17961796
**[⬆ en başa dön](#içindekiler)**
17971797

17981798

1799-
## **Error Handling**
1800-
Thrown errors are a good thing! They mean the runtime has successfully
1801-
identified when something in your program has gone wrong and it's letting
1802-
you know by stopping function execution on the current stack, killing the
1803-
process (in Node), and notifying you in the console with a stack trace.
1804-
1805-
### Don't ignore caught errors
1806-
Doing nothing with a caught error doesn't give you the ability to ever fix
1807-
or react to said error. Logging the error to the console (`console.log`)
1808-
isn't much better as often times it can get lost in a sea of things printed
1809-
to the console. If you wrap any bit of code in a `try/catch` it means you
1810-
think an error may occur there and therefore you should have a plan,
1811-
or create a code path, for when it occurs.
1799+
## **Hata Yakalama**
1800+
Hatalar oluşturmak iyi bir şeydir. Hatalar size programınızda bir şeylerin yolunda olmadığını söylemenin en iyi yoludur.
1801+
Çalışan bir kod parçacığı ya da çalışmayı durduran bir fonksiyonun, process'in neden durduğuna dair konsol ekranında sizi bilgilendirirler.
1802+
1803+
### Yakalanan Hataları Görmezden Gelmeyin
1804+
Yakalanan bir hata ile hiçbir şey gerçekleştirmemek, size o hatayı tamamen fixlemiş olma imkanı sunmaz.
1805+
Hataları (`console.log`) ile göstermek, tıpkı suya yazı yazmak gibidir. Çoğu zaman yetersizdir.
1806+
Eğer kod bölümlerini `try/catch` blokları ile oluşturuyorsanız o bölümde bir hatanın oluşabileceğini düşünüyorsunuzdur.
1807+
Bu durumlar için bir planınız olmalı ya da bu durumları yönetebileceğiniz ayrı kod yapılarınız olmalı.
18121808

18131809
**Kötü:**
18141810
```javascript
18151811
try {
1816-
functionThatMightThrow();
1817-
} catch (error) {
1818-
console.log(error);
1812+
hataFirlatabilecekFonksiyon();
1813+
} catch (hata) {
1814+
console.log(hata);
18191815
}
18201816
```
18211817

18221818
**İyi:**
18231819
```javascript
18241820
try {
1825-
functionThatMightThrow();
1826-
} catch (error) {
1827-
// One option (more noisy than console.log):
1828-
console.error(error);
1829-
// Another option:
1830-
notifyUserOfError(error);
1831-
// Another option:
1832-
reportErrorToService(error);
1833-
// OR do all three!
1821+
hataFirlatabilecekFonksiyon();
1822+
} catch (hata) {
1823+
// İlk seçenek (console.log'dan daha çok bilgilendirici):
1824+
console.error(hata);
1825+
// Diğer Seçenek:
1826+
kullaniciyaHataGoster(hata);
1827+
// Diğer Seçenek:
1828+
hatayiServiseBildir(hata);
1829+
// Ya da üçünü de yapabilirsiniz!!
18341830
}
18351831
```
18361832

0 commit comments

Comments
 (0)