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

+951
-1615
lines changed

bun.lock

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"dotenv": "^16.4.5",
3131
"dotenv-cli": "^7.4.2",
3232
"express": "^4.18.2",
33+
"express-async-errors": "^3.1.1",
3334
"firebase-admin": "^12.2.0",
3435
"sharp": "^0.33.5",
3536
"socket.io": "^4.7.5",
@@ -716,6 +717,8 @@
716717

717718
"express": ["[email protected]", "", { "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", "body-parser": "1.20.3", "content-disposition": "0.5.4", "content-type": "~1.0.4", "cookie": "0.7.1", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", "finalhandler": "1.3.1", "fresh": "0.5.2", "http-errors": "2.0.0", "merge-descriptors": "1.0.3", "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", "path-to-regexp": "0.1.12", "proxy-addr": "~2.0.7", "qs": "6.13.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", "send": "0.19.0", "serve-static": "1.16.2", "setprototypeof": "1.2.0", "statuses": "2.0.1", "type-is": "~1.6.18", "utils-merge": "1.0.1", "vary": "~1.1.2" } }, "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA=="],
718719

720+
"express-async-errors": ["[email protected]", "", { "peerDependencies": { "express": "^4.16.2" } }, "sha512-h6aK1da4tpqWSbyCa3FxB/V6Ehd4EEB15zyQq9qe75OZBp0krinNKuH4rAY+S/U/2I36vdLAUFSjQJ+TFmODng=="],
721+
719722
"extend": ["[email protected]", "", {}, "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g=="],
720723

721724
"farmhash-modern": ["[email protected]", "", {}, "sha512-6ypT4XfgqJk/F3Yuv4SX26I3doUjt0GTG4a+JgWxXQpxXzTBq8fPUeGHfcYMMDPHJHm3yPOSjaeBwBGAHWXCdA=="],

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)