@@ -1500,7 +1500,7 @@ defmodule Kernel do
1500
1500
@ doc """
1501
1501
Raises an error.
1502
1502
1503
- It calls `.exception` on the given argument passing
1503
+ Calls `.exception` on the given argument passing
1504
1504
the args in order to retrieve the appropriate exception
1505
1505
structure.
1506
1506
@@ -1731,8 +1731,8 @@ defmodule Kernel do
1731
1731
1732
1732
* `:pretty` - if set to true enables pretty printing, defaults to false;
1733
1733
1734
- * `:width` - the width avaliable for inspect to lay out the data structure
1735
- representation. Defaults to the least of 80 and terminal width;
1734
+ * `:width` - the width available for inspect to layout the data structure
1735
+ representation. Defaults to the smaller of 80 or the terminal width;
1736
1736
1737
1737
## Examples
1738
1738
@@ -3181,7 +3181,7 @@ defmodule Kernel do
3181
3181
3182
3182
Exceptions are simply records with three differences:
3183
3183
3184
- 1. Exceptions are required to defined a function `exception/1`
3184
+ 1. Exceptions are required to define a function `exception/1`
3185
3185
that receives keyword arguments and returns the exception.
3186
3186
This function is a callback usually invoked by `raise/2`;
3187
3187
@@ -3195,20 +3195,20 @@ defmodule Kernel do
3195
3195
3196
3196
## Raising exceptions
3197
3197
3198
- The most common way to raise an exception is via the raise
3198
+ The most common way to raise an exception is via the ` raise/2`
3199
3199
function:
3200
3200
3201
3201
defexception MyException, [:message]
3202
3202
raise MyException,
3203
- message: "did not get what expected, got: #{ inspect value } "
3203
+ message: "did not get what was expected, got: #{ inspect value } "
3204
3204
3205
- In many cases though, it is more convenient to just pass the
3206
- expected value to raise and generate the message in the `exception/1`
3205
+ In many cases it is more convenient to pass the
3206
+ expected value to ` raise` and generate the message in the `exception/1`
3207
3207
callback:
3208
3208
3209
3209
defexception MyException, [:message] do
3210
3210
def exception(opts) do
3211
- msg = "did not get what expected, got: #{ inspect opts [ :actual ] } "
3211
+ msg = "did not get what was expected, got: #{ inspect opts [ :actual ] } "
3212
3212
MyException[message: msg]
3213
3213
end
3214
3214
end
@@ -3349,7 +3349,7 @@ defmodule Kernel do
3349
3349
specialized one.
3350
3350
3351
3351
Second, falling back to `Any` adds an extra lookup to all types,
3352
- which is unecessary overhead unless an implementation for Any is
3352
+ which is unnecessary overhead unless an implementation for Any is
3353
3353
required.
3354
3354
3355
3355
## Types
0 commit comments