Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

[Soap/Server] add debug mode #5792

Merged
merged 4 commits into from
Mar 4, 2014

Conversation

lilobase
Copy link
Contributor

@lilobase lilobase commented Feb 6, 2014

When an exception is raised the \Zend\Soap\Server catch it and check if this is an authorized exception.
If not, and for security reason, it send an "Unknow error" message.
And if in production its a sane behaviour, its really annoying during development & tests process.

So I propose to add a setDebugMode method, when activated, send all exceptions to the client.

The code is unit-tested.

@@ -926,6 +932,15 @@ protected function _initializeSoapErrorContext()
}

/**
* Set the debug mode.
* In debug mode, all exceptions are send to the client.
* @param boolean $debug
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use bool instead of boolean for consistency

@lilobase
Copy link
Contributor Author

lilobase commented Feb 6, 2014

All right, fixed !

@samsonasik
Copy link
Contributor

👍

@@ -961,6 +976,8 @@ public function registerFaultException($class)
*/
public function isRegisteredAsFaultException($fault)
{
if ($this->debug) return true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one more thing, add open { after if ($this->debug) , so it should be :

if ($this->debug) {
    return true;
}

@lilobase
Copy link
Contributor Author

lilobase commented Feb 8, 2014

done :)

public function setDebugMode($debug = true)
{
$this->debug = $debug;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setters in this class follows fluent interface so please, follow the same pattern,

@lilobase
Copy link
Contributor Author

Changes are committed, UT are updated

@weierophinney weierophinney added this to the 2.3.0 milestone Mar 3, 2014
weierophinney added a commit that referenced this pull request Mar 4, 2014
weierophinney added a commit that referenced this pull request Mar 4, 2014
@weierophinney weierophinney merged commit d704a8a into zendframework:develop Mar 4, 2014
weierophinney added a commit to zendframework/zend-soap that referenced this pull request May 15, 2015
…pServerDebugMode

[Soap/Server] add debug mode
weierophinney added a commit to zendframework/zend-soap that referenced this pull request May 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants