Jump to content

Double try/catch block on export of plugin. How to avoid?


TSP

Recommended Posts

Posted

Hi, 

On exporting a plugin I experience that it exports it with a double try/catch-block

<?php
	public function commentFormElements()
	{
		try
		{
			try
			{
				// My code
			}
			catch ( \RuntimeException $e )
			{
				if ( method_exists( get_parent_class(), __FUNCTION__ ) )
				{
					return call_user_func_array( 'parent::' . __FUNCTION__, func_get_args() );
				}
				else
				{
					throw $e;
				}
			}
		}
		catch ( \RuntimeException $e )
		{
			if ( method_exists( get_parent_class(), __FUNCTION__ ) )
			{
				return call_user_func_array( 'parent::' . __FUNCTION__, func_get_args() );
			}
			else
			{
				throw $e;
			}
		}
	}

How to avoid this?

Okay, totally my bad. For some reason the try/catch-code is actually in the dev code. 

I don't remember putting it there though. 

I guess I can just remove it from the dev code for the plugin, right?

Posted

Yes, you can manually remove it from your plugin dev file. It is added on export, so if you exported at one point and then copied the exported file to your dev environment, that's how this would occur.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...