Files
mercury/java/runtime/Exception.java
Zoltan Somogyi 8e45a89895 Use spaces, not tabs, in the Java and C# runtimes.
Add modelines to keep it that way.

Fix formatting, and english in comments.
2018-07-10 13:52:11 +02:00

31 lines
867 B
Java

// vim: ts=4 sw=4 expandtab ft=java
//
// Copyright (C) 2009 The University of Melbourne.
// Copyright (C) 2018 The Mercury team.
// This file is distributed under the terms specified in COPYING.LIB.
//
package jmercury.runtime;
public class Exception extends java.lang.Error {
// This is to be set when the exception module is initialised,
// to avoid having the runtime depend on the standard library.
public static MethodPtr1 getMessageHook = null;
// Should be univ.Univ_0 but we don't want to depend on the standard
// library.
public Object exception;
public Exception(Object exception) {
this.exception = exception;
}
public String getMessage() {
if (getMessageHook != null) {
return (String) getMessageHook.call___0_0(exception);
} else {
return null;
}
}
}