yahoo/mojito — pull request #1382 by aljimenez (2014-06-13 23:50:20+00:00)
Title: Clearer error messages

There are many different kinds of error conditions due to an invalid configured mojit; however mojito usually prints the undescriptive error below:

```
error: (outputhandler.server): { [Error: Cannot expand instance [searchhtmlframe], or instance.controller is undefined] code: 500 }
```

This makes it difficult to trace the actual problem. This commit addresses this problem by giving more useful error messages as shown below:

#### Mojit is missing:

```
error: (mojito-dispatcher):
Error expanding instance for "searchhtmlframe":
Error: Cannot find the "ShakerPipelineFrame" mojit. Make sure "ShakerPipelineFrame" exists in the application.
at ResourceStore.Y.extend.resolveVersion ...
```

#### Mojit controller is missing
This means either the controller doesn't exist, it never called YUI.add, or it had a syntax error.

```
error: (mojito-dispatcher): Error expanding instance for "searchhtmlframe": no valid controller found in the "ShakerPipelineFrame" mojit
```

#### Mojit specs is missing a type:

```
error: (mojito-dispatcher):
Error expanding instance for "searchhtmlframe":
Error: Instance is missing a mojit type.
at ResourceStore.Y.extend.expandInstanceForEnv ...
```

#### Controller did not set Y.mojito.controller[NAME] properly

**Before:**
```
error: (outputhandler.server): { [Error: Invalid controller name [ShakerPipelineFrameMojit] for mojit [ShakerPipelineFrame].] code: 500 }
```

**After:**
```
error: (mojito-dispatcher): Invalid controller, named "ShakerPipelineFrameMojit", in the "ShakerPipelineFrame" mojit. The controller does not define its actions under Y.namespace('mojito.controllers')['ShakerPipelineFrameMojit']
```