We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 353a29b commit 1e9c57dCopy full SHA for 1e9c57d
1 file changed
lib/util/utimes.js
@@ -4,23 +4,24 @@ const fs = require('../fs')
4
const u = require('universalify').fromPromise
5
6
async function utimesMillis (path, atime, mtime) {
7
- // if (!HAS_MILLIS_RES) return fs.utimes(path, atime, mtime, callback)
8
const fd = await fs.open(path, 'r+')
9
10
- let closeErr = null
+ let error = null
11
12
try {
13
await fs.futimes(fd, atime, mtime)
+ } catch (futimesErr) {
14
+ error = futimesErr
15
} finally {
16
17
await fs.close(fd)
- } catch (e) {
18
- closeErr = e
+ } catch (closeErr) {
19
+ error = closeErr
20
}
21
22
- if (closeErr) {
23
- throw closeErr
+ if (error) {
24
+ throw error
25
26
27
0 commit comments