mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-09-12 13:48:58 +02:00
Improve error handling
This commit is contained in:
@@ -170,7 +170,10 @@ export class GitHubRepository {
|
||||
ghRes.data.encoding as BufferEncoding
|
||||
).toString("utf-8");
|
||||
selected.readme = readme;
|
||||
await model.save();
|
||||
await RepositoryModel.updateOne(
|
||||
{ externalId: this.id, "branches.name": opt.branch },
|
||||
{ $set: { "branches.$.readme": readme } }
|
||||
).exec();
|
||||
} catch (error) {
|
||||
throw new AnonymousError("readme_not_available", {
|
||||
httpStatus: 404,
|
||||
|
||||
Reference in New Issue
Block a user