2005-05-02 04:58:22 +00:00
|
|
|
#include "Error.h"
|
|
|
|
#include "string.h"
|
|
|
|
|
|
|
|
@implementation Error
|
2011-02-14 13:39:43 +00:00
|
|
|
+ (id) type: (string) t message: (string) m by: (SchemeObject *) o
|
2005-05-02 04:58:22 +00:00
|
|
|
{
|
|
|
|
return [[self alloc] initWithType: t message: m by: o];
|
|
|
|
}
|
|
|
|
|
|
|
|
+ (id) type: (string) t message: (string) m
|
|
|
|
{
|
2011-01-14 03:07:40 +00:00
|
|
|
return [[self alloc] initWithType: t message: m by: nil];
|
2005-05-02 04:58:22 +00:00
|
|
|
}
|
|
|
|
|
2011-02-14 13:39:43 +00:00
|
|
|
- (id) initWithType: (string) t message: (string) m by: (SchemeObject *) o
|
2005-05-02 04:58:22 +00:00
|
|
|
{
|
|
|
|
self = [super init];
|
|
|
|
type = str_new();
|
|
|
|
message = str_new();
|
|
|
|
str_copy(type, t);
|
|
|
|
str_copy(message, m);
|
|
|
|
if (o) {
|
|
|
|
[self source: [o source]];
|
|
|
|
[self line: [o line]];
|
|
|
|
}
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (BOOL) isError
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (string) type
|
|
|
|
{
|
|
|
|
return type;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (string) message
|
|
|
|
{
|
|
|
|
return message;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) dealloc
|
|
|
|
{
|
|
|
|
str_free(type);
|
|
|
|
str_free(message);
|
|
|
|
[super dealloc];
|
|
|
|
}
|
|
|
|
@end
|