Deploy Ladill Transfer / deploy (push) Successful in 29s
Expose a stable error_code on chunked upload finalize so webmail can prompt wallet top-up instead of a generic upload failure. Co-authored-by: Cursor <cursoragent@cursor.com>
19 lines
401 B
PHP
19 lines
401 B
PHP
<?php
|
|
|
|
namespace App\Support;
|
|
|
|
use RuntimeException;
|
|
|
|
class TransferWalletErrors
|
|
{
|
|
public const CODE_INSUFFICIENT_WALLET = 'insufficient_wallet';
|
|
|
|
public static function isInsufficientBalance(RuntimeException $e): bool
|
|
{
|
|
$message = strtolower($e->getMessage());
|
|
|
|
return str_contains($message, 'insufficient wallet')
|
|
|| str_contains($message, 'top up');
|
|
}
|
|
}
|