foiaghost incremental and ssl error

This commit is contained in:
James Turk 2023-05-08 01:05:26 -05:00
parent 8ef59d3d3c
commit 41299e8b97
3 changed files with 13 additions and 3 deletions

View File

@ -4,7 +4,7 @@
por bkr --recipe examples.fruits.recipe show
por bkr --recipe examples.fruits.recipe reset
por bkr --recipe examples.fruits.recipe run --input words=examples/fruits.csv
por bkr --recipe examples.fruits.recipe show
```
## Michael's Email

View File

@ -1,3 +1,4 @@
from ssl import SSLCertVerificationError, SSLError
import httpx
from beakers.beakers import Beaker
from beakers.recipe import Recipe
@ -32,5 +33,13 @@ recipe.add_transform(
"good_urls",
"responses",
add_response,
error_map={(httpx.ConnectError, httpx.ConnectTimeout): "bad_requests"},
error_map={
(
httpx.ConnectError,
httpx.ConnectTimeout,
httpx.ReadTimeout,
SSLCertVerificationError,
SSLError,
): "bad_requests"
},
)

View File

@ -68,7 +68,8 @@ class SqliteBeaker(Beaker):
def add_item(self, item: dict, from_table=None, from_id=None) -> None:
self.cursor.execute(
f"INSERT INTO {self.name} (data) VALUES (?)", (json.dumps(item),)
f"INSERT INTO {self.name} (data, from_table, from_id) VALUES (?, ?, ?)",
(json.dumps(item), from_table, from_id),
)
self.recipe.db.commit()