Skip to content

Commit

Permalink
friendlier error messages..?
Browse files Browse the repository at this point in the history
  • Loading branch information
poeticAndroid committed Nov 11, 2019
1 parent af089af commit 6e01f56
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 26 deletions.
4 changes: 2 additions & 2 deletions source/app.d
Expand Up @@ -37,7 +37,7 @@ int main(string[] args)

const ret = loadFreeImage();
if (ret == FISupport.noLibrary)
writeln("Couldn't load FreeImage!");
writeln("FreeImage 3.18 is required!");

// start machine
try
Expand All @@ -58,7 +58,7 @@ int main(string[] args)
}
catch (Exception e)
{
writeln("no config!");
writeln("no config! creating default.");
config = parseJSON("{}");
}
if (!("drives" in config))
Expand Down
4 changes: 2 additions & 2 deletions source/machine.d
Expand Up @@ -26,7 +26,7 @@ import pixmap;
import image_loader;
import network;

const VERSION = "0.9.0"; /// version of the software
const VERSION = "0.9.1"; /// version of the software

/**
Class representing "the machine"!
Expand Down Expand Up @@ -61,7 +61,7 @@ class Machine
this()
{
if (loadSDL() != sdlSupport)
throw new Exception("SDL not work! :(");
throw new Exception("SDL2 2.0.8 is required!");
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK) != 0)
throw new Exception(format("SDL_Init Error: %s", SDL_GetError()));

Expand Down
13 changes: 10 additions & 3 deletions source/program.d
Expand Up @@ -68,9 +68,16 @@ class Program
this.samples ~= null;

// Load the Lua library.
dylib_load_lua();
this.lua = luaL_newstate();
luaL_openlibs(this.lua);
try
{
dylib_load_lua();
this.lua = luaL_newstate();
luaL_openlibs(this.lua);
}
catch (Throwable err)
{
writeln("Lua 5.3 is required!");
}
registerFunctions(this);
string luacode = this.machine.luaFilepathVars(this.filename) ~ readText(
this.actualFile(this.filename));
Expand Down
19 changes: 0 additions & 19 deletions system_drive/libs/class.lua

This file was deleted.

0 comments on commit 6e01f56

Please sign in to comment.