Skip to content

Commit 29594ac

Browse files
committed
Promise Hataları çevirildi
1 parent 5226aee commit 29594ac

File tree

1 file changed

+18
-19
lines changed

1 file changed

+18
-19
lines changed

README.md

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1830,35 +1830,34 @@ try {
18301830
}
18311831
```
18321832

1833-
### Don't ignore rejected promises
1834-
For the same reason you shouldn't ignore caught errors
1835-
from `try/catch`.
1833+
### Promise Hatalarını Görmezden Gelmeyin
1834+
Aynı sebepten dolay `try/catch`'ten kaynaklanan hataları gözardı etmemelisiniz.
18361835

18371836
**Kötü:**
18381837
```javascript
1839-
getdata()
1840-
.then((data) => {
1841-
functionThatMightThrow(data);
1838+
verileriGetir()
1839+
.then((veri) => {
1840+
fonksiyonHataFirlatabilir(veri);
18421841
})
1843-
.catch((error) => {
1844-
console.log(error);
1842+
.catch((hata) => {
1843+
console.log(hata);
18451844
});
18461845
```
18471846

18481847
**İyi:**
18491848
```javascript
1850-
getdata()
1851-
.then((data) => {
1852-
functionThatMightThrow(data);
1849+
verileriGetir()
1850+
.then((veri) => {
1851+
fonksiyonHataFirlatabilir(veri);
18531852
})
1854-
.catch((error) => {
1855-
// One option (more noisy than console.log):
1856-
console.error(error);
1857-
// Another option:
1858-
notifyUserOfError(error);
1859-
// Another option:
1860-
reportErrorToService(error);
1861-
// OR do all three!
1853+
.catch((hata) => {
1854+
// İlk seçenek (console.log'dan daha çok bilgilendirici):
1855+
console.error(hata);
1856+
// Diğer Seçenek:
1857+
kullaniciyaHataGoster(hata);
1858+
// Diğer Seçenek:
1859+
hatayiServiseBildir(hata);
1860+
// Ya da üçünü de yapabilirsiniz!!
18621861
});
18631862
```
18641863

0 commit comments

Comments
 (0)