File tree Expand file tree Collapse file tree 2 files changed +22
-4
lines changed Expand file tree Collapse file tree 2 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -272,10 +272,18 @@ impl IBParser {
272
272
let company_info = self
273
273
. companies_info
274
274
. get ( * symbol)
275
- . ok_or_else ( || anyhow ! ( "Not company info found" ) ) ?;
275
+ . cloned ( )
276
+ . or_else ( || {
277
+ log:: error!( "Not company info found for {}" , symbol) ;
278
+ Some ( CompanyInfo {
279
+ name : symbol. to_string ( ) ,
280
+ isin : "" . to_string ( ) ,
281
+ } )
282
+ } )
283
+ . unwrap ( ) ;
276
284
277
285
Ok ( BalanceNote :: new (
278
- company_info. clone ( ) ,
286
+ company_info,
279
287
String :: from ( "" ) ,
280
288
Decimal :: from_str ( & decimal:: normalize_str ( quantity) ) ?
281
289
* Decimal :: from_str ( & decimal:: normalize_str ( mult) ) ?,
Original file line number Diff line number Diff line change @@ -182,10 +182,20 @@ impl IBCSVParser {
182
182
let company_info = self
183
183
. companies_info
184
184
. get ( symbol)
185
- . ok_or_else ( || anyhow ! ( "Not company info found" ) ) ?;
185
+ . cloned ( )
186
+ . or_else ( {
187
+ || {
188
+ log:: error!( "Not company info found for {}" , symbol) ;
189
+ Some ( CompanyInfo {
190
+ name : symbol. to_string ( ) ,
191
+ isin : "" . to_string ( ) ,
192
+ } )
193
+ }
194
+ } )
195
+ . unwrap ( ) ;
186
196
187
197
Ok ( BalanceNote :: new (
188
- company_info. clone ( ) ,
198
+ company_info,
189
199
String :: from ( "" ) ,
190
200
Decimal :: from_str ( & decimal:: normalize_str ( quantity) ) ?
191
201
* Decimal :: from_str ( & decimal:: normalize_str ( mult) ) ?,
You can’t perform that action at this time.
0 commit comments