Commit 062fc0fe authored by Daan Vreeken's avatar Daan Vreeken
Browse files

Fix error reporting when an incorrect argument is passed to a new block.

The incorrect error was line 3 of the following example:

 ERROR: Too many arguments supplied! This function doesn't accept arguments.
 ERROR: Invalid arguments trying to create block 'heater3'
 ERROR: Could not find create function or struct for block bridge_pwm
 ERROR: pand.ctrl:36: Error creating block

Both the create function and the create struct were found, but the block
wasn't created because the arguments didn't match. This version reports:
 ..
 ERROR: Could not load or create block 'bridge_pwm'

	modified:   controller/controller/controller_load.c
parent 34bf25cf
......@@ -325,8 +325,7 @@ int controller_load_block_create(char *type, char *name, yyscan_t scanner)
if (!file_name) {
log_send(LOG_T_ERROR,
"Could not find create function or struct for block %s",
type);
"Could not load or create block '%s'", type);
return -1;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment