Skip to content

Commit b462ac5

Browse files
committed
remove now unused out-of-stock exception [chapter_08_events_and_message_bus_ends]
1 parent 5a5e07c commit b462ac5

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

src/allocation/domain/model.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
from . import events
66

77

8-
class OutOfStock(Exception):
9-
pass
10-
11-
128
class Product:
139
def __init__(self, sku: str, batches: List[Batch], version_number: int = 0):
1410
self.sku = sku

src/allocation/entrypoints/flask_app.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
from datetime import datetime
22
from flask import Flask, request
3-
from sqlalchemy import create_engine
4-
from sqlalchemy.orm import sessionmaker
53

6-
from allocation.domain import model
74
from allocation.adapters import orm
85
from allocation.service_layer import services, unit_of_work
96

@@ -35,7 +32,7 @@ def allocate_endpoint():
3532
request.json["qty"],
3633
unit_of_work.SqlAlchemyUnitOfWork(),
3734
)
38-
except (model.OutOfStock, services.InvalidSku) as e:
35+
except services.InvalidSku as e:
3936
return {"message": str(e)}, 400
4037

4138
return {"batchref": batchref}, 201

0 commit comments

Comments
 (0)