mirror of
https://github.com/discountry/ritmex-bot.git
synced 2026-09-09 08:18:07 +00:00
31 lines
431 B
Markdown
31 lines
431 B
Markdown
- [Basic Error Handling](./examples/php/)
|
|
|
|
|
|
```php
|
|
<?php
|
|
|
|
include './ccxt.php';
|
|
|
|
date_default_timezone_set('UTC');
|
|
|
|
$exchange = new \ccxt\bittrex ();
|
|
|
|
$message = null;
|
|
|
|
try {
|
|
|
|
$result = $exchange->fetch_ticker ('NONEXISTENT_SYMBOL');
|
|
var_dump ($result);
|
|
|
|
} catch (Exception $e) {
|
|
|
|
// print it
|
|
echo $e->getMessage() . "\n";
|
|
|
|
// save to $message (for whatever needs)
|
|
$message = $e->getMessage();
|
|
}
|
|
|
|
?>
|
|
|
|
``` |