Skip to content

Commit 325d3c3

Browse files
aster-voidnakaterm
authored andcommitted
delete type Result and try catch (#647)
1 parent b381a20 commit 325d3c3

33 files changed

Lines changed: 951 additions & 1615 deletions

bun.lock

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

common/lib/panic.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// unexpected error
2+
export function panic(reason: string): never {
3+
throw new Error(reason, {
4+
cause: "panic",
5+
});
6+
}
7+
8+
// expected error
9+
export function error(reason: string, code?: number): never {
10+
throw new Error(reason, { cause: code });
11+
}

common/lib/result.ts

Lines changed: 0 additions & 116 deletions
This file was deleted.

common/lib/result/safeParseInt.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.

flake.lock

Lines changed: 3 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313

1414
prisma-utils = {
1515
url = "github:VanCoding/nix-prisma-utils";
16-
# HACK: they have named nixpkgs pkgs. I'm submitting a fix PR soon, rename this to `inputs.nixpkgs.follows` when that gets merged.
17-
inputs.pkgs.follows = "nixpkgs";
16+
inputs.nixpkgs.follows = "nixpkgs";
1817
};
1918
};
2019

server/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@
1616
"author": "",
1717
"license": "ISC",
1818
"dependencies": {
19-
"common": "workspace:common",
2019
"@prisma/client": "^5.20.0",
20+
"common": "workspace:common",
2121
"cookie-parser": "^1.4.6",
2222
"cors": "^2.8.5",
2323
"dotenv": "^16.4.5",
2424
"dotenv-cli": "^7.4.2",
2525
"express": "^4.18.2",
26+
"express-async-errors": "^3.1.1",
2627
"firebase-admin": "^12.2.0",
2728
"sharp": "^0.33.5",
2829
"socket.io": "^4.7.5",

server/prisma.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
prisma =
66
(prisma-utils.lib.prisma-factory
77
{
8-
nixpkgs = pkgs;
8+
inherit pkgs;
99
prisma-fmt-hash = "sha256-atD5GZfmeU86mF1V6flAshxg4fFR2ews7EwaJWZZzbc=";
1010
query-engine-hash = "sha256-8FTZaKmQCf9lrDQvkF5yWPeZ7TSVfFjTbjdbWWEHgq4=";
1111
libquery-engine-hash = "sha256-USIdaum87ekGY6F6DaL/tKH0BAZvHBDK7zjmCLo//kM=";

0 commit comments

Comments
 (0)