Skip to content

Commit 504d763

Browse files
committed
Removing try catch on package missing exception
base fetcher fails right below so no point in allowing package.json to be missing here if it's not supported in base
1 parent fd96470 commit 504d763

File tree

1 file changed

+11
-23
lines changed

1 file changed

+11
-23
lines changed

src/fetchers/copy-fetcher.js

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,18 @@ import {MessageError} from '../errors.js';
88

99
export default class CopyFetcher extends BaseFetcher {
1010
async _fetch(): Promise<FetchedOverride> {
11-
try {
12-
const {files} = await this.config.readManifest(this.reference, this.registry);
13-
if (files) {
14-
await Promise.all(
15-
['package.json'].concat(files).map(fileName => {
16-
const source = path.join(this.reference, fileName);
17-
const destination = path.join(this.dest, fileName);
18-
return fs.copy(source, destination, this.reporter);
19-
}),
20-
);
21-
22-
return {
23-
hash: this.hash || '',
24-
resolved: null,
25-
};
26-
}
27-
} catch (err) {
28-
if (err instanceof MessageError) {
29-
this.reporter.warn(err);
30-
} else {
31-
throw err;
32-
}
11+
const {files} = await this.config.readManifest(this.reference, this.registry);
12+
if (files) {
13+
await Promise.all(
14+
['package.json'].concat(files).map(fileName => {
15+
const source = path.join(this.reference, fileName);
16+
const destination = path.join(this.dest, fileName);
17+
return fs.copy(source, destination, this.reporter);
18+
}),
19+
);
20+
} else {
21+
await fs.copy(this.reference, this.dest, this.reporter);
3322
}
34-
await fs.copy(this.reference, this.dest, this.reporter);
3523
return {
3624
hash: this.hash || '',
3725
resolved: null,

0 commit comments

Comments
 (0)