$30 off During Our Annual Pro Sale. View Details »
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
5.5k
大AI時代で輝くために今こそドメインにディープダイブしよう / Deep Dive into Domain in AI-Agent-Era
yuitosato
2
2.4k
50人の組織でAIエージェントを使う文化を作るためには / How to Create a Culture of Using AI Agents in a 50-Person Organization
yuitosato
6
6.6k
Railway Oriented Programming を オニオンアーキテクチャに適用する by kotlin-result / Railway Oriented Programming in Onion Architecture by kotlin-result
yuitosato
4
1.3k
リファクタリングへの耐性が高いモデルベースの統合テストの紹介 / Model-Base Integration Test for Refactoring
yuitosato
7
3.5k
Expressing Business Logic with Types: Functional DDD for OOP
yuitosato
1
160
ビジネスロジックを「型」で表現するOOPのための関数型DDD / Functional And Type-Safe DDD for OOP
yuitosato
44
30k
Java21とKotlinの代数的データ型 & パターンマッチの紹介と本当に嬉しい使い方 / Algebraic Data Type in Java and Kotlin: Happy Use of Pattern Match
yuitosato
14
5.4k
ログラスの継続的ライブラリアップデートのWhyとHow / Why and How to Update Libraries Continuously in Loglass
yuitosato
0
500
Other Decks in Technology
See All in Technology
MySQL AIとMySQL Studioを使ってみよう
ikomachi226
0
120
Sansan Engineering Unit 紹介資料
sansan33
PRO
1
3.2k
AI エージェント活用のベストプラクティスと今後の課題
asei
2
410
"'TSのAPI型安全”の対価は誰が払う?不公平なスキーマ駆動に終止符を打つハイブリッド戦略
hal_spidernight
0
210
Dify on AWS の選択肢
ysekiy
0
120
AI駆動開発2025年振り返りとTips集
knr109
1
140
IPv6-mostly field report from RubyKaigi 2026
sorah
0
230
ローカルVLM OCRモデル + Gemini 3.0 Proで日本語性能を試す
gotalab555
1
240
All About Sansan – for New Global Engineers
sansan33
PRO
1
1.3k
Kill the Vibe?Architecture in the age of AI
stoth
1
130
DDD x Microservice Architecture : Findy Architecture Conf 2025
syobochim
13
7k
Master Dataグループ紹介資料
sansan33
PRO
1
4k
Featured
See All Featured
Product Roadmaps are Hard
iamctodd
PRO
55
12k
The Language of Interfaces
destraynor
162
25k
Why You Should Never Use an ORM
jnunemaker
PRO
60
9.6k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.6k
Testing 201, or: Great Expectations
jmmastey
46
7.8k
How STYLIGHT went responsive
nonsquared
100
5.9k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Raft: Consensus for Rubyists
vanstee
140
7.2k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.1k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.8k
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 ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ