Skip to content

Commit 0ff6718

Browse files
committed
Fixed handling of error responses
This fixes #2.
1 parent 8ff2eac commit 0ff6718

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

receita/tools/build.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
class Build(object):
99

10+
ERROR = 'ERROR'
11+
1012
def __init__(self, input_, output):
1113
self.input = os.path.abspath(input_)
1214
self.output = os.path.abspath(output)
@@ -91,6 +93,8 @@ def write(self, data):
9193

9294
writer.writeheader()
9395
for company in data:
96+
if company['status'] == self.ERROR:
97+
continue
9498
for activity in company['atividade_principal']:
9599
writer.writerow({
96100
'cnpj': company['cnpj'],

0 commit comments

Comments
 (0)