Skip to content

Commit fd1662f

Browse files
committed
update
1 parent be55f59 commit fd1662f

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

src/alchemlyb/workflows/abfe.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,27 +113,27 @@ def read(self):
113113
f'Reading {len(u_nk)} lines of u_nk from {file}')
114114
u_nk_list.append(u_nk)
115115
except Exception as exc:
116-
msg = f'Error reading read u_nk from {file}.'
116+
msg = f'Error reading read u_nk from {file}.\n{exc}'
117117
if self.ignore_warnings:
118-
self.logger.exception(msg + f'\n{exc}\n' +
118+
self.logger.exception(msg +
119119
'This exception is being ignored because ignore_warnings=True.')
120120
else:
121-
self.logger.error(msg)
122-
raise ValueError(msg) from exc
121+
self.logger.exception(msg)
122+
raise type(exc)(msg)
123123

124124
try:
125125
dhdl = self._extract_dHdl(file, T=self.T)
126126
self.logger.info(
127127
f'Reading {len(dhdl)} lines of dhdl from {file}')
128128
dHdl_list.append(dhdl)
129129
except Exception as exc:
130-
msg = f'Error reading read dhdl from {file}.'
130+
msg = f'Error reading read dhdl from {file}.\n{exc}'
131131
if self.ignore_warnings:
132-
self.logger.exception(msg + f'\n{exc}\n' +
132+
self.logger.exception(msg +
133133
'This exception is being ignored because ignore_warnings=True.')
134134
else:
135-
self.logger.error(msg)
136-
raise ValueError(msg) from exc
135+
self.logger.exception(msg)
136+
raise type(exc)(msg)
137137

138138
# Sort the files according to the state
139139
self.logger.info('Sort files according to the u_nk.')

0 commit comments

Comments
 (0)