Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
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.8k
大AI時代で輝くために今こそドメインにディープダイブしよう / Deep Dive into Domain in AI-Agent-Era
yuitosato
2
2.6k
50人の組織でAIエージェントを使う文化を作るためには / How to Create a Culture of Using AI Agents in a 50-Person Organization
yuitosato
6
6.8k
Railway Oriented Programming を オニオンアーキテクチャに適用する by kotlin-result / Railway Oriented Programming in Onion Architecture by kotlin-result
yuitosato
4
1.4k
リファクタリングへの耐性が高いモデルベースの統合テストの紹介 / Model-Base Integration Test for Refactoring
yuitosato
7
3.6k
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.5k
ログラスの継続的ライブラリアップデートのWhyとHow / Why and How to Update Libraries Continuously in Loglass
yuitosato
0
500
Other Decks in Technology
See All in Technology
バグハンター視点によるサプライチェーンの脆弱性
scgajge12
3
1k
5分で知るMicrosoft Ignite
taiponrock
PRO
0
230
ログ管理の新たな可能性?CloudWatchの新機能をご紹介
ikumi_ono
1
550
Noを伝える技術2025: 爆速合意形成のためのNICOフレームワーク速習 #pmconf2025
aki_iinuma
2
2.1k
eBPFとwaruiBPF
sat
PRO
4
2.5k
大企業でもできる!ボトムアップで拡大させるプラットフォームの作り方
findy_eventslides
1
580
エンジニアリングマネージャー はじめての目標設定と評価
halkt
0
250
A Compass of Thought: Guiding the Future of Test Automation ( #jassttokai25 , #jassttokai )
teyamagu
PRO
1
250
Haskell を武器にして挑む競技プログラミング ─ 操作的思考から意味モデル思考へ
naoya
5
940
re:Invent2025 コンテナ系アップデート振り返り(+CloudWatchログのアップデート紹介)
masukawa
0
320
多様なデジタルアイデンティティを攻撃からどうやって守るのか / 20251212
ayokura
0
320
[JAWS-UG 横浜支部 #91]DevOps Agent vs CloudWatch Investigations -比較と実践-
sh_fk2
1
240
Featured
See All Featured
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.2k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
37
2.6k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.8k
Typedesign – Prime Four
hannesfritz
42
2.9k
How GitHub (no longer) Works
holman
316
140k
Embracing the Ebb and Flow
colly
88
4.9k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.1k
The Invisible Side of Design
smashingmag
302
51k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
390
Producing Creativity
orderedlist
PRO
348
40k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.1k
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 ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ