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

[br] 1st translation of "Exceptions.md" #68

Closed
wants to merge 2 commits into from

Conversation

gustavosarturi
Copy link

No description provided.

Copy link
Contributor

@abelsiqueira abelsiqueira left a comment

Choose a reason for hiding this comment

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

Obrigado. Fiz algumas correções.

| Define NewExcep | `struct NewExcep <: Exception`<br>`v::String`<br>`end`<br><br>`Base.showerror(io::IO, e::NewExcep) = print(io, "A problem with $(e.v)!")`<br><br>`throw(NewExcep("x"))` |
| Throw error with msg text | `error(msg)` |
| Handler | `try`<br>`# do something potentially iffy`<br>`catch ex`<br>`if isa(ex, SomeExcep)`<br>`# handle SomeExcep`<br>`elseif isa(ex, AnotherExcep)`<br>`# handle AnotherExcep`<br>`else`<br>`# handle all others`<br>`finally`<br>`# do this in any case`<br>`end`⁠ |
| Lançar algumas exceções | `throw(SomeExcep())` |
Copy link
Contributor

Choose a reason for hiding this comment

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

Lançar AlgumaExcecao. Do lado direito SomeExcep -> AlgumaExcecao

| Handler | `try`<br>`# do something potentially iffy`<br>`catch ex`<br>`if isa(ex, SomeExcep)`<br>`# handle SomeExcep`<br>`elseif isa(ex, AnotherExcep)`<br>`# handle AnotherExcep`<br>`else`<br>`# handle all others`<br>`finally`<br>`# do this in any case`<br>`end`⁠ |
| Lançar algumas exceções | `throw(SomeExcep())` |
| Relançar exceção atual | `rethrow()` |
| Definir NewExcep | `struct NewExcep <: Exception`<br>`v::String`<br>`end`<br><br>`Base.showerror(io::IO, e::NewExcep) = print(io, "A problem with $(e.v)!")`<br><br>`throw(NewExcep("x"))` |
Copy link
Contributor

Choose a reason for hiding this comment

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

Traduzir NewExcep

| Lançar algumas exceções | `throw(SomeExcep())` |
| Relançar exceção atual | `rethrow()` |
| Definir NewExcep | `struct NewExcep <: Exception`<br>`v::String`<br>`end`<br><br>`Base.showerror(io::IO, e::NewExcep) = print(io, "A problem with $(e.v)!")`<br><br>`throw(NewExcep("x"))` |
| Erro de lançamento com mensagem | `error(msg)` |
Copy link
Contributor

Choose a reason for hiding this comment

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

Lançar erro com mensagem

| Relançar exceção atual | `rethrow()` |
| Definir NewExcep | `struct NewExcep <: Exception`<br>`v::String`<br>`end`<br><br>`Base.showerror(io::IO, e::NewExcep) = print(io, "A problem with $(e.v)!")`<br><br>`throw(NewExcep("x"))` |
| Erro de lançamento com mensagem | `error(msg)` |
| Handler | `try`<br>`# do something potentially iffy`<br>`catch ex`<br>`if isa(ex, SomeExcep)`<br>`# handle SomeExcep`<br>`elseif isa(ex, AnotherExcep)`<br>`# handle AnotherExcep`<br>`else`<br>`# handle all others`<br>`finally`<br>`# do this in any case`<br>`end`⁠ |
Copy link
Contributor

Choose a reason for hiding this comment

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

Tratamento,
fazer algo potencialmente errado
SomeExcep -> AlgumaExcecao
lidar com AlgumaExcecao
AnotherExcep -> OutraExcecao
lidar com todas outras
Faça isto em todos casos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants