Skip to content

Commit 82ccb94

Browse files
authored
File.LinkError - swap order of new and existing in error message (#14441)
1 parent ea2ae22 commit 82ccb94

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: lib/elixir/lib/exception.ex

+4-4
Original file line numberDiff line numberDiff line change
@@ -2492,8 +2492,8 @@ defmodule File.LinkError do
24922492
24932493
For example, this exception is raised when trying to link to file that isn't present:
24942494
2495-
iex> File.ln!("source.txt", "target.txt")
2496-
** (File.LinkError) could not create hard link from "source.txt" to "target.txt": no such file or directory
2495+
iex> File.ln!("existing.txt", "link.txt")
2496+
** (File.LinkError) could not create hard link from "link.txt" to "existing.txt": no such file or directory
24972497
24982498
The following fields of this exception are public and can be accessed freely:
24992499
@@ -2509,8 +2509,8 @@ defmodule File.LinkError do
25092509
def message(exception) do
25102510
formatted = IO.iodata_to_binary(:file.format_error(exception.reason))
25112511

2512-
"could not #{exception.action} from #{inspect(exception.existing)} to " <>
2513-
"#{inspect(exception.new)}: #{formatted}"
2512+
"could not #{exception.action} from #{inspect(exception.new)} to " <>
2513+
"#{inspect(exception.existing)}: #{formatted}"
25142514
end
25152515
end
25162516

0 commit comments

Comments
 (0)