Feat: Adds multi currency support (#88)
This commit is contained in:
@@ -18,9 +18,10 @@ class FallbackInterface
|
||||
foreach ($providers as $provider) {
|
||||
|
||||
$provider = trim($provider);
|
||||
$symbol = $arguments[0];
|
||||
|
||||
try {
|
||||
Log::warning("Calling method {$method} ({$provider})");
|
||||
Log::info("Calling method {$method} for {$symbol} ({$provider})");
|
||||
|
||||
if (! in_array($provider, array_keys(config('investbrain.interfaces', [])))) {
|
||||
|
||||
@@ -35,17 +36,17 @@ class FallbackInterface
|
||||
|
||||
$this->latest_error = $e->getMessage();
|
||||
|
||||
Log::warning("Failed calling method {$method} ({$provider}): {$this->latest_error}");
|
||||
Log::error("Failed calling method {$method} for {$symbol} ({$provider}): {$this->latest_error}");
|
||||
}
|
||||
}
|
||||
|
||||
// don't need to throw error if calling exists
|
||||
// don't need to throw error if calling exists method...
|
||||
if ($method == 'exists') {
|
||||
|
||||
// symbol prob just doesn't exist
|
||||
return false;
|
||||
}
|
||||
|
||||
throw new \Exception("Could not get market data: {$this->latest_error}");
|
||||
throw new \Exception("Could not get market data calling method {$method}: {$this->latest_error}");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user