aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPeter Andersson <[email protected]>2014-03-06 19:01:53 +0100
committerPeter Andersson <[email protected]>2014-03-06 19:01:53 +0100
commit3dee3b4cddf4347bb1bd72ca446fa18397556c7b (patch)
tree9bc1b14a1d7ea20cf58f19e3d30fec7465e34552 /lib
parent544fb141916d8676bc763318074e4d0783414af1 (diff)
downloadotp-3dee3b4cddf4347bb1bd72ca446fa18397556c7b.tar.gz
otp-3dee3b4cddf4347bb1bd72ca446fa18397556c7b.tar.bz2
otp-3dee3b4cddf4347bb1bd72ca446fa18397556c7b.zip
Add more info to file open failure
Diffstat (limited to 'lib')
-rw-r--r--lib/test_server/src/test_server_ctrl.erl10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/test_server/src/test_server_ctrl.erl b/lib/test_server/src/test_server_ctrl.erl
index dcf905db24..a56074ca0a 100644
--- a/lib/test_server/src/test_server_ctrl.erl
+++ b/lib/test_server/src/test_server_ctrl.erl
@@ -5476,10 +5476,16 @@ write_html_file(File,Content) ->
%% The 'major' log file, which is a pure text file is also written
%% with utf8 encoding
open_utf8_file(File) ->
- file:open(File,[write,{encoding,utf8}]).
+ case file:open(File,AllOpts=[write,{encoding,utf8}]) of
+ {error,Reason} -> {error,{Reason,{File,AllOpts}}};
+ Result -> Result
+ end.
open_utf8_file(File,Opts) ->
- file:open(File,[{encoding,utf8}|Opts]).
+ case file:open(File,AllOpts=[{encoding,utf8}|Opts]) of
+ {error,Reason} -> {error,{Reason,{File,AllOpts}}};
+ Result -> Result
+ end.
%% Write a file with specified encoding
write_file(File,Content,latin1) ->