File tree Expand file tree Collapse file tree 3 files changed +4
-18
lines changed Expand file tree Collapse file tree 3 files changed +4
-18
lines changed Original file line number Diff line number Diff line change @@ -1694,7 +1694,8 @@ defmodule UndefinedFunctionError do
1694
1694
1695
1695
For example:
1696
1696
1697
- iex> String.non_existing_fun("hello")
1697
+ # Let's use apply/3 as otherwise Elixir emits a compile-time warning
1698
+ iex> apply(String, :non_existing_fun, ["hello"])
1698
1699
** (UndefinedFunctionError) function String.non_existing_fun/1 is undefined or private
1699
1700
1700
1701
The following fields of this exception are public and can be accessed freely:
Original file line number Diff line number Diff line change @@ -14,24 +14,14 @@ defmodule ExceptionTest do
14
14
doctest Exception
15
15
16
16
doctest RuntimeError
17
- doctest ArgumentError
18
- doctest ArithmeticError
19
17
doctest SystemLimitError
20
18
doctest MismatchedDelimiterError
21
19
doctest SyntaxError
22
20
doctest TokenMissingError
23
- doctest BadFunctionError
24
- doctest BadMapError
25
21
doctest BadBooleanError
26
- doctest MatchError
27
- doctest CaseClauseError
28
- doctest WithClauseError
29
- doctest CondClauseError
30
- doctest TryClauseError
31
22
doctest UndefinedFunctionError
32
23
doctest FunctionClauseError
33
24
doctest Protocol.UndefinedError
34
- doctest KeyError
35
25
doctest UnicodeConversionError
36
26
doctest Enum.OutOfBoundsError
37
27
doctest Enum.EmptyError
Original file line number Diff line number Diff line change @@ -409,12 +409,9 @@ defmodule Kernel.RaiseTest do
409
409
end
410
410
411
411
test "badfun error" do
412
- # Avoid "invalid function call" warning
413
- x = fn -> :example end
414
-
415
412
result =
416
413
try do
417
- x . ( ) . ( 2 )
414
+ Process . get ( :unused , :example ) . ( 2 )
418
415
rescue
419
416
x in [ BadFunctionError ] -> Exception . message ( x )
420
417
end
@@ -537,12 +534,10 @@ defmodule Kernel.RaiseTest do
537
534
end
538
535
539
536
test "try clause error" do
540
- f = fn -> :example end
541
-
542
537
result =
543
538
try do
544
539
try do
545
- f . ( )
540
+ Process . get ( :unused , :example )
546
541
rescue
547
542
_exception ->
548
543
:ok
You can’t perform that action at this time.
0 commit comments