aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Andersson <[email protected]>2014-03-12 16:57:37 +0100
committerPeter Andersson <[email protected]>2014-03-12 16:57:37 +0100
commitf406a1661f8b0106b1b203057aedbb60d8d3a6be (patch)
tree0869ac214667b05b950093df1652eee231bfdacb
parentd7f10591bca66cc22b3d56d831373717708abf8a (diff)
parent3dee3b4cddf4347bb1bd72ca446fa18397556c7b (diff)
downloadotp-f406a1661f8b0106b1b203057aedbb60d8d3a6be.tar.gz
otp-f406a1661f8b0106b1b203057aedbb60d8d3a6be.tar.bz2
otp-f406a1661f8b0106b1b203057aedbb60d8d3a6be.zip
Merge branch 'peppe/common_test/test_server_enoent_crash'
* peppe/common_test/test_server_enoent_crash: Add more info to file open failure
-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) ->