Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
例外は"投げない"〜Scalableエラー処理入門
Search
YuitoSato
December 22, 2017
Technology
3
1.2k
例外は"投げない"〜Scalableエラー処理入門
https://d-cube.connpass.com/event/74106/
「教養としてのScala ~ そろそろ始めてみたい2017冬」のLTのひとつです。
YuitoSato
December 22, 2017
Tweet
Share
More Decks by YuitoSato
See All by YuitoSato
「規約、知識、オペレーション」から考える中規模以上の開発組織のCursorルールの 考え方・育て方 / Cursor Rules for Coding Styles, Domain Knowledges and Operations
yuitosato
9
6.4k
大AI時代で輝くために今こそドメインにディープダイブしよう / Deep Dive into Domain in AI-Agent-Era
yuitosato
2
3k
50人の組織でAIエージェントを使う文化を作るためには / How to Create a Culture of Using AI Agents in a 50-Person Organization
yuitosato
6
7.2k
Railway Oriented Programming を オニオンアーキテクチャに適用する by kotlin-result / Railway Oriented Programming in Onion Architecture by kotlin-result
yuitosato
5
1.4k
リファクタリングへの耐性が高いモデルベースの統合テストの紹介 / Model-Base Integration Test for Refactoring
yuitosato
7
3.7k
Expressing Business Logic with Types: Functional DDD for OOP
yuitosato
1
160
ビジネスロジックを「型」で表現するOOPのための関数型DDD / Functional And Type-Safe DDD for OOP
yuitosato
44
31k
Java21とKotlinの代数的データ型 & パターンマッチの紹介と本当に嬉しい使い方 / Algebraic Data Type in Java and Kotlin: Happy Use of Pattern Match
yuitosato
14
5.5k
ログラスの継続的ライブラリアップデートのWhyとHow / Why and How to Update Libraries Continuously in Loglass
yuitosato
0
510
Other Decks in Technology
See All in Technology
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
10k
名刺メーカーDevグループ 紹介資料
sansan33
PRO
0
1k
[PR] はじめてのデジタルアイデンティティという本を書きました
ritou
1
800
Oracle Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
2
820
あの夜、私たちは「人間」に戻った。 ── 災害ユートピア、贈与、そしてアジャイルの再構築 / 20260108 Hiromitsu Akiba
shift_evolve
PRO
0
540
I tried making a solo advent calendar!
zzzzico
0
150
テストセンター受験、オンライン受験、どっちなんだい?
yama3133
0
210
Introduction to Sansan, inc / Sansan Global Development Center, Inc.
sansan33
PRO
0
2.9k
Oracle Database@Azure:サービス概要のご紹介
oracle4engineer
PRO
3
310
Introduction to Sansan Meishi Maker Development Engineer
sansan33
PRO
0
330
小さく、早く、可能性を多産する。生成AIプロジェクト / prAIrie-dog
visional_engineering_and_design
0
400
Qiita Bash アドカレ LT #1
okaru
0
180
Featured
See All Featured
Designing for Performance
lara
610
70k
Exploring anti-patterns in Rails
aemeredith
2
220
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
44
Bash Introduction
62gerente
615
210k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
0
410
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.3k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
What's in a price? How to price your products and services
michaelherold
246
13k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
0
3.4k
Become a Pro
speakerdeck
PRO
31
5.8k
Design in an AI World
tapps
0
120
How GitHub (no longer) Works
holman
316
140k
Transcript
ETDBMB ྫ֎l͛ͳ͍z d4DBMBCMFΤϥʔॲཧೖd ϏζϦʔνࠤ౻༗ే
ETDBMB ͢ਓ w ৽ଔ w ֶੜͷࠒ3VCZ w ۀͰ4DBMBͱ5ZQF4DSJQU w 4DBMBྺ
ࠤ౻༗ేʢ!:VJJJUPUPʣ
ETDBMB Έͳ͞Μ
ETDBMB ྫ֎
ETDBMB ͛ͯ·͔͢ʁ
ETDBMB ྫ֎
ETDBMB ัͬͯ·͔͢ʁ
ETDBMB ྫ֎Λ͛ͳ͍ Τϥʔॲཧ͋Γ·͢ ͱ͍͏Λ͠·͢
ETDBMB ࠓͷΰʔϧ w 4DBMBͷΤϥʔॲཧΛΔ w ྫ֎Λ͛ΔҎ֎ͷΤϥʔॲཧ͕͋Δ͜ͱΔ
ETDBMB Τϥʔॲཧͷྺ࢙ ͬ͘͟Γ PS/VMM࣌ ྫ֎ॲཧ ΤϥʔʹҙຯΛ͍࣋ͨͤͨ Τϥʔ·ͱΊͯॲཧ͍ͨ͠
ETDBMB ྫ֎ॲཧͱʁ ݺͼग़͠ݩ ϝιου */ Τϥʔʂ $BUDIઅ ίʔϧελοΫΛͨͲΔ 065
ETDBMB ͭΒ͍͜ͱ͋Δ ݺͼग़͠ݩ ϝιου 065 ίʔϧελοΫΛͨͲΔ $BUDIઅ
ETDBMB ੍ޚϑϩʔ͕̎ͭ
ETDBMB ͭΒ͍͜ͱᶄ ݺͼग़͠ݩ ϝιου 065 Τϥʔʂ ίʔϧελοΫΛͨͲΔ ❓❓ */
ETDBMB $BUDI͠ΕΔ
ETDBMB ͭΒ͍͜ͱ·ͱΊ ੍ޚϑϩʔ͕ෳࡶ ΤϥʔॲཧΕ
ETDBMB ͍ͨ͜͠ͱ·ͱΊ ੍ޚϑϩʔΛཧ ΤϥʔॲཧΛڧ੍
ETDBMB ੍ޚϑϩʔΛཧ͢Δʹ ݺͼग़͠ݩ ϝιου &SSPSPS ਖ਼ৗ &SSPSPS ਖ਼ৗ ΤϥʔҰͭͷΦϒδΣΫτͱͯ͠ฦ͢
ETDBMB ͦ͜Ͱ4DBMBͩʂ
ETDBMB ͦ͜Ͱ&JUIFSͩʂ
ETDBMB 4DBMBͷ&JUIFSͱʁ w ̎ͭͷΦϒδΣΫτΛอ࣋Ͱ͖ΔΫϥε w ࣦഊ࣌ -FGU ͷΦϒδΣΫτɺޭ࣌ 3JHIU ͷΦϒδΣΫτΛอ࣋
w ̎ͭಉ࣌อ࣌Ͱ͖ͳ͍ &JUIFS -FGU 3JHIU
ETDBMB ࣮ࡍʹॻ͍ͯΈΑ͏ def signUp(email: String): Either[Error, User] = { If
(email.length < 5) { Left(Error(“Too Short Email!”)) } else { Right(User(email)) } } case class Error(msg: String) case class User(email: String) ฦΓ ϝιου new & return Class
ETDBMB ࣮ࡍʹॻ͍ͯΈΑ͏ def signUp(email: String): Either[Error, User] = { If
(email.length < 5) { Left(Error(“Too Short Email!”)) } else { Right(User(email)) } } case class Error(msg: String) case class User(email: String) &JUIFS -FGU &SSPS 3JHIU 6TFS
ETDBMB ͭ·Γ͜͏͍͏͜ͱ ݺͼग़͠ݩ TJHO6Q &JUIFS -FGU &SSPS 3JHIU 6TFS &JUIFS
-FGU &SSPS 3JHIU 6TFS String
ETDBMB Τϥʔॲཧڧ੍Ͱ͖Δ def main(args: Array[String]): Unit = { val either=
signUp(“
[email protected]
”) either match { case Right(user) => logger.info(user.email) case Left(error) => logger.error(error.msg) } } ޭͳΒ ࣦഊͳΒ
ETDBMB ඒ͍͠ʢओ؍ʣ
ETDBMB ͓͞Β͍ w ΤϥʔPSਖ਼ৗͱ͍͏Λฦ੍ͯ͠ޚϑϩʔΛཧ͢Δ w &JUIFSΤϥʔॲཧΛڧ੍Ͱ͖Δ w ʢ͝ར༻ܭըతʹʣ
ETDBMB ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ