Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error handling, "try..catch" #90

Closed
wants to merge 8 commits into from
Closed

Error handling, "try..catch" #90

wants to merge 8 commits into from

Conversation

VibingCreator
Copy link

No description provided.

@CLAassistant
Copy link

CLAassistant commented Jan 24, 2021

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


VibingCreator seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link

@akowalska622 akowalska622 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor, mostly subjective, comments. In general looks really good

@@ -1,47 +1,47 @@
The difference becomes obvious when we look at the code inside a function.
Jeśli umieścimy pierwszy fragment w środku funkcji, szybko zauważymy różnicę.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

W tłumaczeniu jest trochę zmienione znaczenie, "szybko", to nie to samo co "becomes obvious"


The behavior is different if there's a "jump out" of `try..catch`.
Występuje ona w momencie wyjścia z instrukcji `try...catch`.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tutaj również zmienione jest znaczenie. Nie mówię, że powinno być 100% słowo w słowo, ale znaczeniowo trochę odbiega od oryginału

} catch (e) {
// ...
if("can't handle the error") {
if("nie interesują mnie błędy") {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?


1. The first one uses `finally` to execute the code after `try..catch`:
1. Pierwszy fragment zawiera blok `finally`, naturalnie wykona się jako ostatni ze wszystkich bloków instrukcji:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Odbiega od oryginału


But there's a syntax construct `try..catch` that allows to "catch" errors and, instead of dying, do something more reasonable.
Przy użyciu instrukcji `try...catch`, możemy obsłużyć błędy w bardziej sensowny sposób.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fajnie by było uwzględnić jeszcze jakoś ten fragment "instead of dying", to ważne, że przy try...catch nie powodujemy zatrzymania skryptu


}
```

````warn header="`try...catch` umożliwia obsługę błędów napotkanych tylko w trakcie wykonywania się programu (ang. Runtime Errors)"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Proszę umieść to na tej samej linii kodu co angielska wersja, zgodnie z instrukcją w repozytorium

}
```
Silnik JavaScript najpierw odczytuje kod, a dopiero potem go wykonuje. Błędy podczas fazy analizy kodu nie mogą zostać obsłużone w pierwszym bloku instrukcji, ponieważ niepoprawnie komunikujemy się z silnikiem.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jak powyżej, pilnuj linijek


`stack`
: Current call stack: a string with information about the sequence of nested calls that led to the error. Used for debugging purposes.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warto dodać w nawiasie (ang. call stack)

// ...
}
```

## Using "try..catch"
## Zastosowanie "try...catch" w życiu codziennym

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Po co dopisek "w życiu codziennym"?


As we already know, JavaScript supports the [JSON.parse(str)](mdn:js/JSON/parse) method to read JSON-encoded values.
Na tym etapie powinniśmy już wiedzieć o metodzie [JSON.parse(str)](mdn:js/JSON/parse), która umożliwia nam przetworzenie obiektu JSON.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lepiej trzymać się tu oryginalnej wersji "Jak już wiemy".
"Powinniśmy" może stawiać czytelnika w pozycji, nomen omen, powinności, co nie jest tu dobrym konstruktem

@javascript-translate-bot

Please make the requested changes. After it, add a comment "/done".
Then I'll ask for a new review 👻

@bartek7
Copy link
Contributor

bartek7 commented Oct 28, 2022

Hej, zacząłem tłumaczyć ten rozdział. Czy dany pull request jest jeszcze w miarę aktualny i powinienem przestać tłumaczyć czy jak? Na liście tłumaczeń nie było tego tematu zajętego.

@CheerfulCherry
Copy link
Contributor

Hej, wydaje mi się, że jeśli nie było nikogo przypisanego, to możesz śmiało jechać z tematem 🙂
Jeśli chcesz sobie zaoszczędzić pracy, to możesz zaciągnąć aktualny progres tego tłumaczenia i zastosować się do komentarzy.
Widzę, że przypisałeś się również do innego tematu. Ilość tłumaczeń się oczywiście ceni, ale postaraj się nie przypisywać siebie do kolejnego tłumaczenia, jeśli nie skończyłeś tłumaczyć pierwszego wybranego tematu.

@bartek7
Copy link
Contributor

bartek7 commented Oct 29, 2022

@RafalMichniuk
Nie, nie. Nie chcę po kimś poprawiać. Za dużo tego robię w codziennej pracy. Zacznę od zera, tymbardziej, że uważam, że te tłumaczenia nie powinny być 1:1, bo składane zdania są wtedy komiczne.

Co do ilości tłumaczonych tematów w jednym momencie - teoretycznie masz rację, ale tematy, które wziąłem są ze sobą ściśle powiązane. Więc wolałem się za nie zabrać w 100%. Z drugiej strony widzę, że tłumaczenia idą jak krew z nosa, więc akurat w tym przypadku cieszmy się, że ktokolwiek chce to tłumaczyć.

@CheerfulCherry
Copy link
Contributor

Przyznaję, że w tym wypadku oczywiście masz rację, jednak na przyszłość postaraj się trzymać wytycznych zawartych w opisie dla tłumaczących: For New Translators

@bartek7
Copy link
Contributor

bartek7 commented Oct 29, 2022

Luzik arbuzik :)

@VibingCreator VibingCreator closed this by deleting the head repository Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants