package background;

import gui.GUIText;

public class ErrorHandler {
	public IOManager ioManager;
	public CommandManager commandManager;
	
	public GUIText guiTexts; 
	
	public ErrorHandler(IOManager io, CommandManager cm, GUIText gui) {
		ioManager = io;
		commandManager = cm;
		guiTexts = gui;
	}
	
	public void errorHappened(String type) {
		String s = guiTexts.getErrorText(type);		
		ioManager.addError(s);
		commandManager.finishCurrentVisualisation();
	}

}
