Da Pig helping Da Penguin

2021.09.26 03:25 Blueberry_Pear Da Pig helping Da Penguin

Da Pig helping Da Penguin submitted by Blueberry_Pear to deadbydaylight [link] [comments]


2021.09.26 03:25 RatchetWerks Do user-based edge cases (ie declined credit card), warrant throwing/catching error objects in Node apps?

I'm struggling to wrap my head around the "layers" of error handling in Node.js. I've read and re-read the following material:
Node.js Best Practices List on Github
Node.dev documentation
A heavily backlinked Joyent blog post
From my research there are two formal classes of errors: 1. Operational errors 2. Programmer errors
Operational errors: Loosely defined as errors that are expected and can be accounted for. - Someone unplugged a power cord in the cloud - Intermittent network connection - Too much load on a servehigh latency - Bad user inputs
Programmer errors: Errors that occurred due to programmer bugs - Type-mismatching: Dividing a number by a string - Calling functions that don't exist - Connecting to misconfigured 3rd party services (SQL,Redis,etc)
Reading in-between the lines, operational errors can have two sub categories. - Computer based errors * - Network stopped working - Server didn't respond - High latency - *User based errors - User gave a credit card that declined - User registering already existing email account - User applied applied a coupon that has expired or doesn't exist - Any business logic related errors/edge cases
Now here's my question:
Why does it feel wrong to create/return error objects for user-based errors in the promise chain? If it's left uncaught it can crash the server.
Now let's be specific.
Your user is going to create an account for an email that is already registered.
The flow of code is : - Route.ts(Incoming HTTP Call) - Controller.ts(Business Logic Layer) - Model.ts(Database Call)
There are two ways to handle this. 1. Let it go down to the database, the database throws an non-unique constraint error. Then let it bubble up and handle it. If uncaught, the server goes down. (This feels wrong)

  1. Account for all possible user-based errors in the business logic layer (UserController.ts) Never actually throw an error(UserController.js). Just return an object that tells the Router(HTTP layer) to return a 4XX type code.
Does anyone have any guidance or strong opinions on this?
Code is below.
UserRoute.ts ```typescript authRouter.post("/register", async function (req, res) { const { email, password } = req.body;
const result = await createUser(email, password).catch((e) => { console.error(e); });
res.send(result); }); ```
UserController.ts
```typescript export async function createUser(email: string, password: string) { const exists = await findUserByEmail(email); if (!exists) { const saltHash = generatePasswordHash(password); const salt = saltHash.salt; const hash = saltHash.hash;
const newUser = await addUser(email, hash, salt).catch((e) => { console.error(e); }); return newUser; 
} else { return new Error("Already has account"); } } ```
UserModel.ts ```typescript export async function addUser(email: string, password: string, salt: string) { const newUser = await prisma.user .create({ data: { email: email, password: password, salt: salt, }, }) .catch((e: PrismaClientKnownRequestError) => { if (e.code === "P2002") { throw Error("User already exsits"); } else console.error(e); });
return newUser; }
```
submitted by RatchetWerks to node [link] [comments]


2021.09.26 03:25 prawnbiryani 💗☁🍦🌸🧁🤍🦩

💗☁🍦🌸🧁🤍🦩 submitted by prawnbiryani to 11hr11min [link] [comments]


2021.09.26 03:25 dontmakenosenses 600 homemade bubble booty bratz videos 💯 message meee while I’m up

600 homemade bubble booty bratz videos 💯 message meee while I’m up submitted by dontmakenosenses to LilBecky [link] [comments]


2021.09.26 03:25 clcwolf Where is Pulura's Falls?

That's all I want to know. I'm in Act V and want to head there, but don't know where on the map it is. Just, in relation to some other landmarks, where is this location?
submitted by clcwolf to Pathfinder_Kingmaker [link] [comments]


2021.09.26 03:25 SirGoblinton Red Oni [Pixel Dailies]

submitted by SirGoblinton to PixelArt [link] [comments]


2021.09.26 03:25 HouseExtreme4749 Futurama is coming back, don't ask how I know, trust me.

Remember the prophecy.
submitted by HouseExtreme4749 to futurama [link] [comments]


2021.09.26 03:25 tylenolhd2 Can’t choose between these four. I said I was looking for minimal, timeless, and romantic but the two bohemian ones threw me.

Can’t choose between these four. I said I was looking for minimal, timeless, and romantic but the two bohemian ones threw me. submitted by tylenolhd2 to weddingdress [link] [comments]


2021.09.26 03:25 TrueNorthXCIV Anyone here go from 12 pro or max go just iphone 13 ?

submitted by TrueNorthXCIV to iPhone13 [link] [comments]


2021.09.26 03:25 thegolden35 Multiplayer dreams

Imagine one day (in the not too distant future?) where you can run around with a group of friends, each replacing an AI, and the station gets busier as a result of that!
everything is in real-time, so it could be a realistic goal, right?
Here’s to hoping!
submitted by thegolden35 to GasStationSimulator [link] [comments]


2021.09.26 03:25 CryptoVines 🌱Plant Token🌱 Crypto Freelance Marketplace🏪 Liquidity Locked 1yr🔒 Weekly Lottery 🎲 Doxxed Dev✅ Do work, Get paid in crypto☀️


👇Trade tokens👇
🥞Pancake swap🥞

At Plant Token we have aimed to make a defi token with automated rewards and a use case for longterm holders. We want to help restore the environment and the confidence in the crypto space. We will start by building a strong community and prove that we are here to stay.
We are a token with a real use case in the future. We are currently building a freelance marketplace platform for the crypto community. Creating a space where both buyers and sellers can come to an agreement for their goods, service, NFT, or anything else.
We are currently pushing ahead with our marketing, and have influencers posting about us frequently. Our roadmap on our website shows you our progress in development. We are also currently writing our whitepaper, and soon will have a more updated website design.
Our community is built upon the basis of the token being completely transparent allowing investors to not worry. We have doxxed devs who are active on the telegram to help with any issues or questions you have. The Plant Token army continues to grow and getting stronger. The telegram is growing and active 24/7. The project is still very new and we currently have a low number of holders! Within a month we hope to have many more! We are growing fast and healthy, and hope to continue this into the future.

📝Token Information:
☀️Name : Plant Token
☀️Symbol : PLANT
☀️Blockchain : BSC
☀️Total Supply : 161,211,420 $PLANT

✅Contract Address : 0xdC243F2cF20106B53C7b5A6fd4756C1a920a59DC

🚨TOKENOMICS : 10% Tax On Transactions
🌱3% Donated To Charity
💪🏼2% Distributed To All Holders
🔒2% Liquidity Locked
🔥2% Burnt
☀️1% Surprise Sprouts Lottery

Lottery drawings every week!

✅Links
📣Telegram: https://t.me/planttoken
🌏WebSite: https://www.PlantToken.Co
🐥Twitter: https://Twitter.com/PlantToken
☀️GitHub: https://github.com/PlantToken
submitted by CryptoVines to CryptoMoon [link] [comments]


2021.09.26 03:25 Maxacat Sofya Zhuk

Sofya Zhuk submitted by Maxacat to GirlsTennis [link] [comments]


2021.09.26 03:25 Ok_Chair21 Let’s gooooo

I got a 365 day streak on Duolingo
submitted by Ok_Chair21 to teenagers [link] [comments]


2021.09.26 03:25 the_oraclex I need some advice

I like to solo que in threes since I like to play threes and I really wasn't seeing if anyone wanted to play threes. I get in three seconds in one of my teammates get kicked for AFK and over the game my other teammate being brutally honest plays like a mid gold and the other team is low lvl's that are smurfing in a plat lobby being overly toxic... I'm out of excuses here is it me ? I spend time in training before I start playing I have a decent knowledge of rotations and know not to go for the ball when I'm the last man back and when I need to I can go for aerial shots and challenges (its hit and miss if I hit the ball)and kick-offs aren't too bad as well. I can play up to high to mid plat if I have one of those god sessions but those come rare for me... I almost had myself in diamond earlier this season I just dropped like a stone the last couple of weeks and I have barely a clue why I'm dropping so much.
submitted by the_oraclex to RocketLeague [link] [comments]


2021.09.26 03:25 officially_lazy nexis - Lazy

nexis - Lazy submitted by officially_lazy to selfmusic [link] [comments]


2021.09.26 03:25 inflowjet Hurricane Sam explosively intensifies into Category 4, the 4th major storm of the Atlantic Hurricane Season. Continues west towards the Lesser Antilles, then a track shift towards Bermuda or even the United States is forecast.

Hurricane Sam explosively intensifies into Category 4, the 4th major storm of the Atlantic Hurricane Season. Continues west towards the Lesser Antilles, then a track shift towards Bermuda or even the United States is forecast. submitted by inflowjet to environment [link] [comments]


2021.09.26 03:25 NILwasAMistake check me

submitted by NILwasAMistake to CommentRemovalChecker [link] [comments]


2021.09.26 03:25 TheZugster GSK STYLE

GSK STYLE submitted by TheZugster to gammasecretkings [link] [comments]


2021.09.26 03:25 creativeaftercoffee That dog

That dog submitted by creativeaftercoffee to aesthetics13_art [link] [comments]


2021.09.26 03:25 Iceman222333 Seasons

Now that we have seasons will decor change. Example. October have Halloween decorations. December Christmas trees and lights. July on American map fireworks at night for independence day.
submitted by Iceman222333 to farmingsimulator [link] [comments]


2021.09.26 03:25 NYYankees1958 Wanted one since Departed. Not as practical as my Glock 42, but if I was going to add another 380 had to be the PPK.

Wanted one since Departed. Not as practical as my Glock 42, but if I was going to add another 380 had to be the PPK. submitted by NYYankees1958 to Walther [link] [comments]


2021.09.26 03:25 mapfiltercar they made me strong now their weak


Processing img ve8707ee2rp71...
https://preview.redd.it/co1kasbg2rp71.png?width=1063&format=png&auto=webp&s=de5a62676d8114d7396940d43d170175f987086a
submitted by mapfiltercar to pyrocynical [link] [comments]


2021.09.26 03:25 pelanom Got surprised me with this upgrade

submitted by pelanom to Kayaking [link] [comments]


2021.09.26 03:25 AeroKnight197 Vybz Kartel - African Summer (Official Music Video)

Vybz Kartel - African Summer (Official Music Video) submitted by AeroKnight197 to videos [link] [comments]


2021.09.26 03:25 kyjo767676 Id?

Id? submitted by kyjo767676 to shroomery [link] [comments]


http://kafe-melnitsa.ru