Skip to content

Commit f69f94e

Browse files
authored
Merge pull request #285 from cortizg/es.javascript.info.1-10-2-eh
Custom errors, extending Error
2 parents 25c66f6 + 0abe1c0 commit f69f94e

File tree

3 files changed

+91
-91
lines changed

3 files changed

+91
-91
lines changed

1-js/10-error-handling/2-custom-errors/1-format-error/solution.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ class FormatError extends SyntaxError {
66
}
77
}
88

9-
let err = new FormatError("formatting error");
9+
let err = new FormatError("error de formato");
1010

11-
alert( err.message ); // formatting error
11+
alert( err.message ); // error de formato
1212
alert( err.name ); // FormatError
13-
alert( err.stack ); // stack
13+
alert( err.stack ); // pila
1414

1515
alert( err instanceof SyntaxError ); // true
1616
```

1-js/10-error-handling/2-custom-errors/1-format-error/task.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@ importance: 5
22

33
---
44

5-
# Inherit from SyntaxError
5+
# Heredar de SyntaxError
66

7-
Create a class `FormatError` that inherits from the built-in `SyntaxError` class.
7+
Cree una clase `FormatError` que herede de la clase incorporada `SyntaxError`.
88

9-
It should support `message`, `name` and `stack` properties.
9+
Debería admitir las propiedades `message`, `name` y `stack`.
1010

11-
Usage example:
11+
Ejemplo de uso:
1212

1313
```js
14-
let err = new FormatError("formatting error");
14+
let err = new FormatError("error de formato");
1515

16-
alert( err.message ); // formatting error
16+
alert( err.message ); // error de formato
1717
alert( err.name ); // FormatError
18-
alert( err.stack ); // stack
18+
alert( err.stack ); // pila
1919

2020
alert( err instanceof FormatError ); // true
21-
alert( err instanceof SyntaxError ); // true (because inherits from SyntaxError)
21+
alert( err instanceof SyntaxError ); // true (porque hereda de SyntaxError)
2222
```

0 commit comments

Comments
 (0)