This section describes many of the error messages you can receive when using Anise. Each error message will contain the line number in the Anise script where the problem occurred, as well as a description of what went wrong. If you run into problems, this is the first place you should check.

Preprocessor Errors

The #build directive requires an object name as an argument
This happens when a #build directive is declared without an argument. You should a valid name for an object declared in your Anise script as an argument.
The #converter directive requires an argument which is the name of a subclass of AniseTypeConverter
This happens when fail to provide an argument to a #converter directive. Update your declaration to include the fully-qualified class name of a subclass of AniseTypeConverter .
Error creating converter: "converter name"
This error occurs when the preprocessor is unable to create an instance of a AniseTypeConverter provided in a #converter declaration. Be sure that you've provided the fully-qualified class name, and that you haven't misspelled any part of it. Also, check that you've included the assembly which contains that class with an appropriate #using directive before the #converter directive.
The #environment directive only accepts "on" or "off": "value"
This error occurs if you provide any value other than "on" or "off" to the #environment directive. Check that you haven't used alternate values (e.g., "true" and "false"), and that there aren't any stray characters on that line.
The #import directive must have a file name as an argument
This error occurs when you fail to provide a file name as an argument to the #import directive. Check your declaration and ensure that a file name is present.
Failed to import file: "file"
You'll receive this error whenever the preprocessor was not able to find the file mentioned in an #import directive. You should double-check the spelling of the path, and be sure the path is either an absolute path, or relative to the interpreter's current working directory.
The #using directive requires the name of an assembly as an argument
This error occurs when you fail to provide an assembly name as an argument to the #using directive.
Failed to load assembly: "assembly"
This error occurs when the preprocessor was unable to load an assembly specified in a #using directive. First, double-check your spelling, and then double-check that the required assembly exists and is either in one of the standard locations for DLLs or has been specified by a previously declared #codebase directive.

Parser Errors

Expected a value after '='
This error means that you have an incomplete Pair declaration. Either the interpreter reached the end of the file, or the end of the parent container (e.g., the } which closes a Dictionary). Check the line mentioned and be sure you haven't forgotten to finish the Pair declaration and don't have a misplaced a } character.
Expected '{'
This error will occur whenever the interpreter expected to see a Dictionary declaration, but saw some other character instead. Double-check that line to be sure there aren't any stray characters there.
Expected '}'
This error will occur whenever the interpreter sees the end of the file or the end of the parent container when it was expecting to see the end of a Dictionary declaration. It is mandatory that all Dictionaries be closed, even if they are the last declaration in the file. Double-check that you haven't left out a } character prior to the line mentioned in the error, and check that you've properly closed all quoted strings.
Expected '['
This error will occur whenever the interpreter expected to see an Array declaration, but saw some other character instead. Double-check that line to be sure there aren't any stray characters there.
Expected ']'
This error will occur whenever the interpreter sees the end of the file or the end of the parent container when it was expecting to see the end of an Array declaration. It is mandatory that all Arrays be closed, even if they are the last declaration in the file. Double-check that you haven't left out a ] character prior to the line mentioned in the error, and check that you've properly closed all quoted strings.
Expected '@'
This error will occur whenever the interpreter expected to see a Reference declaration, but saw some other character instead. Double-check that line to be sure there aren't any stray characters there.

Object Building Errors

Instantiation Errors

An error occurred determining the assembly for "type"
This error occurs if an exception is thrown by the C# reflection system while attempting to determine which assembly a particular class is in. Check the inner exception to determine the best course of action to correct the problem.
An error occurred trying to build object name
This error occurs when a #build directive was unable to instantiate an object as requested. Check the inner exception to determine the best course of action to correct the problem.
Failed to instantiate a new object name
This error occurs when a requested object could not be built. Check the inner exception to see what the underlying cause is.

Constructor Errors

Could not find a default constructor for type, and no _constructor property was provided
This error occurs when a class does not have a default (i.e., zero-argument) constructor, but you haven't specified any other constructor using the _constructor meta-property. To correct the problem, either add a _constructor meta-property declaration to the object which matches an existing constructor, or add a default constructor to the object.
Found multiple constructor declarations for object name when only one is permitted
This error occurs when you have multiple _constructor meta-properties in the same Dictionary. To correct the problem, simply remove all but one of the _constructor declarations.
Could not find any constructor for type which accepts number argument(s)
This happens when there is no constructor on the given object will accepts the number of parameters given in the _constructor Array. Either adjust the number of parameters you're passing in, alter an existing constructor to accept that number of arguments, or create a new constructor which accepts that number of arguments.
Could not select a constructor for type because it has multiple constructors which accept number argument(s)
This error occurs when there are multiple constructors which have the same number of arguments as the _constructor Array. In this case, Anise can't determine which of the constructors to use. (see section on the #converter directive for details). You can resolve this problem either by changing the number of elements in the _constructor Array to call a different constructor, or by altering one of the constructors to have more or fewer arguments.
Failed to invoke constructor for type
This error occurs whenever an exception is thrown by a constructor when an object is instantiated. Check the inner exception to determine the actual problem.

Scope Errors

Unknown scope "text"
This error occurs when a value is assigned to the _scope meta-property other than one of the four supported scope types (i.e., prototype , invocation , container , or singleton ). Check your _scope declaration for mispellings, extra characters, or a missing semi-colon.

Property Assignment Errors

Could not find an assignable member named "property/method name"
This error occurs when no method or property could be found matching the given name. To resolve the issue, double-check your spelling and number of arguments (for method calls).
Failed to assign property "property name" on type "type"
This error occurs when an exception is thrown from a property assignment. Check the inner exception to determine the actual cause of the error.

Method Invocation Errors

Method invocations must have an array of parameters
This error occurs when a method invocation Pair is specified with anything other than an Array as the value. Check the Pair to ensure you haven't forgotten to include the [ ] characters. These are required even if you don't have multiple (or any) arguments.
Failed to call method "method name" on type "type"
This error occurs when a method call throws an exception during invocation. Check the inner exception for details on the actual problem.
Could not select a method because there are multiple methods named "method name" which accept number argument(s)
This error occurs when there are multiple methods which have the same number of arguments as the method Pair's value Array. In this case, Anise can't determine which of the methods to use. (see section on the #converter directive for details). You can resolve this problem either by calling a different method by changing the number of elements in the parameters Array, or by altering one of the methods to have more or fewer arguments.
Could not find an overload for method "method name" on type which accepts number argument(s)
This error is thrown when method invocation is detected, and at least one method with that name is found, but none is available which accepts the number of arguments in the parameters Array. To correct the problem, try: double-checking the number of arguments in your parameters Array, making sure you didn't miss a comma, ensuring that you properly closed all quotes, and that the method being invoked has the expected number of arguments.

Type Conversion Errors

Could not find a converter able to convert a type to a type
This error occurs during a property assignment, method invocation, or constructor invocation when an object must be converted to a different type, but no converter is available to make the translation. To correct the error, you should double-check that you aren't missing a _class meta-property on any of the parameters, and that the property/method/constructor's arguments are what you expect. If all that is correct, you can either create the object explicitly (instead of relying on an automatic conversion), or implement and register a new converter class. You'll generally want to do the former if you are making relatively few conversions, and the latter if you need to perform a lot of conversions.
An error occurred trying to convert a type to a type using a converter
This error occurs when a converter throws an exception during an attempted conversion. Check the inner exception to see what the actual problem is.

Last edited Jun 28, 2010 at 1:19 AM by aminer, version 2

Comments

No comments yet.