Skip to content
This repository was archived by the owner on Oct 29, 2022. It is now read-only.

Commit ecf5b7d

Browse files
committed
fixed some silly errors
1 parent 312334a commit ecf5b7d

File tree

5 files changed

+18
-18
lines changed

5 files changed

+18
-18
lines changed

source/actionscript/agnostic/src/eu/alebianco/air/extensions/analytics/GATracker.as

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ package eu.alebianco.air.extensions.analytics
7171
try
7272
{
7373
getInstance();
74-
supported = instance.context.call("isSupported") == false;
74+
supported = instance.context.call("isSupported") == true;
7575
}
7676
catch(error:Error)
7777
{
@@ -165,7 +165,7 @@ package eu.alebianco.air.extensions.analytics
165165
{
166166
native = handleResult(context.call("getVersion"), String) as String;
167167
}
168-
finally
168+
catch(error:Error)
169169
{
170170
native = "<unknown>";
171171
}

source/android/src/eu/alebianco/air/extensions/analytics/functions/SetCustomVar.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,15 @@ public FREObject call(FREContext context, FREObject[] args) {
6464
name = args[1].getAsString();
6565
} catch (Exception e) {
6666
FREUtils.logEvent(context, LogLevel.FATAL, "Unable to read the 'name' parameter.\n(Exception:[name:%s,reason:%s,method:%s])",
67-
FREUtils.stripPackageFromClassName(e.toString()), e.getMessage(), e.getMessage(), FREUtils.getClassName());
67+
FREUtils.stripPackageFromClassName(e.toString()), e.getMessage(), FREUtils.getClassName());
6868
return FREUtils.createRuntimeException("ArgumentError", 0, "Unable to read the 'name' parameter on method '%s'.", FREUtils.getClassName());
6969
}
7070

7171
try {
7272
value = args[2].getAsString();
7373
} catch (Exception e) {
7474
FREUtils.logEvent(context, LogLevel.FATAL, "Unable to read the 'value' parameter.\n(Exception:[name:%s,reason:%s,method:%s])",
75-
FREUtils.stripPackageFromClassName(e.toString()), e.getMessage(), e.getMessage(), FREUtils.getClassName());
75+
FREUtils.stripPackageFromClassName(e.toString()), e.getMessage(), FREUtils.getClassName());
7676
return FREUtils.createRuntimeException("ArgumentError", 0, "Unable to read the 'value' parameter on method '%s'.", FREUtils.getClassName());
7777
}
7878

@@ -81,7 +81,7 @@ public FREObject call(FREContext context, FREObject[] args) {
8181
scope = (args.length >= 4) ? Math.max(1, Math.min(3, args[3].getAsInt())) : 3;
8282
} catch (Exception e) {
8383
FREUtils.logEvent(context, LogLevel.WARN, "Unable to read the 'scope' parameter.\n(Exception:[name:%s,reason:%s,method:%s])",
84-
FREUtils.stripPackageFromClassName(e.toString()), e.getMessage(), e.getMessage(), FREUtils.getClassName());
84+
FREUtils.stripPackageFromClassName(e.toString()), e.getMessage(), FREUtils.getClassName());
8585
}
8686
}
8787

source/android/src/eu/alebianco/air/extensions/analytics/functions/StartNewSession.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public FREObject call(FREContext context, FREObject[] args) {
6262
interval = args[1].getAsInt();
6363
} catch (Exception e) {
6464
FREUtils.logEvent(context, LogLevel.FATAL, "Unable to read the 'interval' parameter.\n(Exception:[name:%s,reason:%s,method:%s])",
65-
FREUtils.stripPackageFromClassName(e.toString()), e.getMessage(), e.getMessage(), FREUtils.getClassName());
65+
FREUtils.stripPackageFromClassName(e.toString()), e.getMessage(), FREUtils.getClassName());
6666
return FREUtils.createRuntimeException("ArgumentError", 0, "Unable to read the 'interval' parameter on method '%s'.", FREUtils.getClassName());
6767
}
6868

source/android/src/eu/alebianco/air/extensions/analytics/functions/TrackEvent.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public FREObject call(FREContext context, FREObject[] args) {
6464
action = args[1].getAsString();
6565
} catch (Exception e) {
6666
FREUtils.logEvent(context, LogLevel.FATAL, "Unable to read the 'action' parameter.\n(Exception:[name:%s,reason:%s,method:%s])",
67-
FREUtils.stripPackageFromClassName(e.toString()), e.getMessage(), e.getMessage(), FREUtils.getClassName());
67+
FREUtils.stripPackageFromClassName(e.toString()), e.getMessage(), FREUtils.getClassName());
6868
return FREUtils.createRuntimeException("ArgumentError", 0, "Unable to read the 'action' parameter on method '%s'.", FREUtils.getClassName());
6969
}
7070

@@ -73,7 +73,7 @@ public FREObject call(FREContext context, FREObject[] args) {
7373
label = args[2].getAsString();
7474
} catch (Exception e) {
7575
FREUtils.logEvent(context, LogLevel.WARN, "Unable to read the 'label' parameter.\n(Exception:[name:%s,reason:%s,method:%s])",
76-
FREUtils.stripPackageFromClassName(e.toString()), e.getMessage(), e.getMessage(), FREUtils.getClassName());
76+
FREUtils.stripPackageFromClassName(e.toString()), e.getMessage(), FREUtils.getClassName());
7777
}
7878
}
7979

@@ -82,7 +82,7 @@ public FREObject call(FREContext context, FREObject[] args) {
8282
value = args[3].getAsInt();
8383
} catch (Exception e) {
8484
FREUtils.logEvent(context, LogLevel.WARN, "Unable to read the 'value' parameter.\n(Exception:[name:%s,reason:%s,method:%s])",
85-
FREUtils.stripPackageFromClassName(e.toString()), e.getMessage(), e.getMessage(), FREUtils.getClassName());
85+
FREUtils.stripPackageFromClassName(e.toString()), e.getMessage(), FREUtils.getClassName());
8686
}
8787
}
8888

source/android/src/eu/alebianco/air/extensions/utils/FREUtils.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,25 @@ public static String stripPackageFromClassName(String className)
3232
return className.substring(className.lastIndexOf(".") + 1);
3333
}
3434

35-
private static StackTraceElement getStackInfo(int i)
36-
{
37-
return new Exception().getStackTrace()[i];
38-
}
3935
private static StackTraceElement getStackInfo()
4036
{
41-
return getStackInfo(1);
37+
return new Exception().getStackTrace()[2];
4238
}
4339

4440
public static FREObject createRuntimeException(String className, int id, String message, Object... data) {
4541

4642
FREObject error = null;
4743
FREObject[] args = new FREObject[2] ;
4844
try {
49-
args[2] = FREObject.newObject(id);
50-
args[1] = FREObject.newObject(String.format(message, data));
45+
args[0] = FREObject.newObject(String.format(message, data));
46+
args[1] = FREObject.newObject(id);
5147
error = FREObject.newObject(className, args);
52-
} catch (Exception e1) {
53-
Log.println(LogLevel.ERROR.getPriority(), LOGTAG, String.format("Inception Error: Unable to create the runtime exception to notify the application about the previous error.\n[Error:(type:%s, message:%s]", stripPackageFromClassName(className), String.format(message, data)));
48+
} catch (Exception e) {
49+
Log.println(LogLevel.ERROR.getPriority(), LOGTAG, String.format("Inception Error: Unable to create the runtime exception to notify the application about the previous error.\n" +
50+
"[Error:(type:%s, message:%s]\n" +
51+
"[Error:(type:%s, message:%s]",
52+
stripPackageFromClassName(e.toString()), e.getMessage(),
53+
stripPackageFromClassName(className), String.format(message, data)));
5454
}
5555
return error;
5656
}

0 commit comments

Comments
 (0)