Skip to content

Incorrect error handling when passed API key is wrong #16

Closed
@DarkSnowCat

Description

@DarkSnowCat

Hi guys,

looks like the following code with using a wrong key:

$client = new Client('nope');
$voiceResource = new VoiceResource($client);

 // Setting up and testing params
$voiceParams = new VoiceParams($message, implode(',', $recipients));
$voiceParams->setRingtime(60);
$voiceResource->validate($voiceParams);

$voiceResponse = $voiceResource->call($voiceParams);

results in:

[2024-11-28 09:25:49] local.ERROR: Seven\Api\Resource\Voice\Voice::__construct(): Argument #1 ($data) must be of type object, int given, called in .../seven.io/api/src/Resource/Voice/VoiceResource.php on line 31

Shouldn't there be some kind of error handling?

Greets Michael

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions