Sencha Cmd version(s) tested:
  • Sencha Cmd v3.1.0.256

Operating System:
  • Windows7

Framework used::
  • ExtJs4.2.0.663

Description:
  • When a json config file is malformed (comma forgotten as well), log error don't mention the wrong filename. Even in debug mode, stack trace is not more explicit on this file.

Steps to reproduce the problem:
  • In your theme, remove a comma from the config file package.json
Code:
{
    "name": "my-theme-classic",
    "type": "theme",
    "extend": "ext-theme-classic"  //HERE COMMA IS MISSING
    "creator": "LudoO",
    "version": "1.0.0",
    "compatVersion": "1.0.0",
    "local": true,
    "requires": []
}
The result that was expected:
  • Log shows which file is malformed

The result that occurs instead:
  • Error and stacktrace is not useful to retrieve the wrong file.
Code:
C:\dev\js\extjs\projects\MyProject>sencha app build
Sencha Cmd v3.1.0.256
[ERR] com.google.gson.stream.MalformedJsonException: Unterminated object at line 5 column 6
Code:
C:\dev\js\extjs\projects\MyProject>sencha --debug app build
Sencha Cmd v3.1.0.256
[DBG] Loading CommandProviders
[DBG] Scanning for extensions in C:\tools\dev\SenchaSDKTools-3.1.0\Sencha\Cmd\3.1.0.256\extensions
[DBG] loading extension from C:\tools\dev\SenchaSDKTools-3.1.0\Sencha\Cmd\3.1.0.256\extensions\sencha-compass
[DBG] Loaded extension sencha-compass
[DBG] loading extension from C:\tools\dev\SenchaSDKTools-3.1.0\Sencha\Cmd\3.1.0.256\extensions\sencha-io
...
[ERR] com.google.gson.stream.MalformedJsonException: Unterminated object at line 5 column 6
     at com.sencha.exceptions.BasicException.wrap(BasicException.java:44)
     at com.sencha.cli.Command.dispatch(Command.java:64)
     at com.sencha.cli.Commands.dispatch(Commands.java:62)
     at com.sencha.cli.Commands.dispatch(Commands.java:62)
     at com.sencha.command.Sencha.dispatch(Sencha.java:72)
     at com.sencha.command.Sencha.main(Sencha.java:123)
   Caused by: com.google.gson.stream.MalformedJsonException: Unterminated object at line 5 column 6
     at com.google.gson.Gson.fromJson(Gson.java:805)
     at com.google.gson.Gson.fromJson(Gson.java:757)
     at com.google.gson.Gson.fromJson(Gson.java:706)
     at com.google.gson.Gson.fromJson(Gson.java:678)
     at com.sencha.util.JsonUtil.fromJson(JsonUtil.java:99)
     at com.sencha.tools.pkg.Model$Package.load(Model.java:952)
     at com.sencha.command.environment.WorkspaceRepository.scanWorkspacePackages(WorkspaceRepository.java:155)
     at com.sencha.command.environment.WorkspaceRepository.getWorkspaceCatalog(WorkspaceRepository.java:174)
     at com.sencha.command.environment.WorkspaceRepository.getWorkspaceCatalog(WorkspaceRepository.java:169)
     at com.sencha.command.environment.WorkspaceRepository.getCatalog(WorkspaceRepository.java:87)
     at com.sencha.command.environment.WorkspaceRepository.getPackage(WorkspaceRepository.java:123)
     at com.sencha.command.environment.WorkspaceEnvironment.getPackageEnvironment(WorkspaceEnvironment.java:136)
     at com.sencha.command.environment.AppEnvironment.getThemePackageEnvironment(AppEnvironment.java:85)
     at com.sencha.command.environment.AppEnvironment.getThemePackageEnvironments(AppEnvironment.java:294)
     at com.sencha.command.environment.AppEnvironment.getThemePackageNames(AppEnvironment.java:306)
     at com.sencha.command.app.AppCommands$BuildCommand.getParameters(AppCommands.java:124)
     at com.sencha.command.BasePluginCommands$BasePluginCommand.doExecute(BasePluginCommands.java:23)
     at com.sencha.command.app.AppCommands$BuildCommand.execute(AppCommands.java:108)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
     at java.lang.reflect.Method.invoke(Unknown Source)
     at com.sencha.util.MethodInvoker$Arguments.invoke(MethodInvoker.java:174)
     at com.sencha.cli.Command.dispatch(Command.java:42)
     at com.sencha.cli.Commands.dispatch(Commands.java:62)
     at com.sencha.cli.Commands.dispatch(Commands.java:62)
     at com.sencha.command.Sencha.dispatch(Sencha.java:72)
     at com.sencha.command.Sencha.main(Sencha.java:123)
   Caused by: Unterminated object at line 5 column 6
     at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1310)
     at com.google.gson.stream.JsonReader.nextInObject(JsonReader.java:722)
     at com.google.gson.stream.JsonReader.peek(JsonReader.java:382)
     at com.google.gson.stream.JsonReader.hasNext(JsonReader.java:349)
     at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:166)
     at com.google.gson.Gson.fromJson(Gson.java:791)
     at com.google.gson.Gson.fromJson(Gson.java:757)
     at com.google.gson.Gson.fromJson(Gson.java:706)
     at com.google.gson.Gson.fromJson(Gson.java:678)
     at com.sencha.util.JsonUtil.fromJson(JsonUtil.java:99)
     at com.sencha.tools.pkg.Model$Package.load(Model.java:952)
     at com.sencha.command.environment.WorkspaceRepository.scanWorkspacePackages(WorkspaceRepository.java:155)
     at com.sencha.command.environment.WorkspaceRepository.getWorkspaceCatalog(WorkspaceRepository.java:174)
     at com.sencha.command.environment.WorkspaceRepository.getWorkspaceCatalog(WorkspaceRepository.java:169)
     at com.sencha.command.environment.WorkspaceRepository.getCatalog(WorkspaceRepository.java:87)
     at com.sencha.command.environment.WorkspaceRepository.getPackage(WorkspaceRepository.java:123)
     at com.sencha.command.environment.WorkspaceEnvironment.getPackageEnvironment(WorkspaceEnvironment.java:136)
     at com.sencha.command.environment.AppEnvironment.getThemePackageEnvironment(AppEnvironment.java:85)
     at com.sencha.command.environment.AppEnvironment.getThemePackageEnvironments(AppEnvironment.java:294)
     at com.sencha.command.environment.AppEnvironment.getThemePackageNames(AppEnvironment.java:306)
     at com.sencha.command.app.AppCommands$BuildCommand.getParameters(AppCommands.java:124)
     at com.sencha.command.BasePluginCommands$BasePluginCommand.doExecute(BasePluginCommands.java:23)
     at com.sencha.command.app.AppCommands$BuildCommand.execute(AppCommands.java:108)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
     at java.lang.reflect.Method.invoke(Unknown Source)
     at com.sencha.util.MethodInvoker$Arguments.invoke(MethodInvoker.java:174)
     at com.sencha.cli.Command.dispatch(Command.java:42)
     at com.sencha.cli.Commands.dispatch(Commands.java:62)
     at com.sencha.cli.Commands.dispatch(Commands.java:62)
     at com.sencha.command.Sencha.dispatch(Sencha.java:72)
     at com.sencha.command.Sencha.main(Sencha.java:123)